I have been using php with mamp on mac for a year even with old versions of MacOS, since I installed MacOS Monterrey if I type Show Using older versions of MacOS I have never had this problem. How can I solve the problem?
leymannx 4,8995 gold badges40 silver badges45 bronze badges asked Oct 31, 2021 at 11:02
3 When I update MacOS Monterey, PHP was remove. I found this article it useful and solve this problem for me. https://wpbeaches.com/updating-to-php-versions-7-4-and-8-on-macos-12-monterey Add the PHP formulae
Choose the PHP version – this example uses 7.4
Link the PHP Version
Restart the Terminal
answered Nov 22, 2021 at 13:30
1 Homebrew users: This can happen simply because your php version is not linked. Goto /usr/local/Cellar, list out the content and see what versions of php you have installed. You should see directories and symlinks as so:
If the version you want is there, you can link it with Then your bash should have php defined. Installing php again will also work, because it will add the symlink in the install process; but you only likely actually need the symlink. answered Jan 4 at 18:39
1 I have same problem and this is the solution that I use for this.
Dharman♦ 27.7k21 gold badges75 silver badges126 bronze badges answered Nov 5, 2021 at 1:48
If you want the latest PHP release in macOS Monterey then follow these steps: 1: 2: 3: to check if its working, write this
in the terminal: if you get something along the lines of PHP 8.2.0-dev (cli) then its working answered Feb 16 at 18:52
0 You have to edit the file .zshrc
and Then you update the path for your php type on "?" search "php" ... type enter, it will show you the line where php is. If not you have to add the path of your PHP. You use Mamp, then it should on the root of mamp. set it on your .zshrc This my .zshrc related to php :
answered May 11 at 23:22
Kam DaneKam Dane 501 silver badge8 bronze badges Just using
answered Sep 6 at 17:33
You probably need to fix it in the
Do this: Open the terminal and run this command:
Then add this line in the
Save and exit ( answered Oct 31, 2021 at 12:03
Nabeel KhanNabeel Khan 3,4182 gold badges22 silver badges35 bronze badges 1 Not the answer you're looking for? Browse other questions tagged php macos macos-monterey or ask your own question.Where is PHP installed on my Mac?Set the php. ini location or use the default A typical default location on macOS is /usr/local/php/php.
Is PHP already installed on Mac?PHP is bundled with macOS since macOS X (10.0. 0) prior to macOS Monterey (12.0. 0). Compiling is similar to the Unix installation guide.
How do I download PHP for Mac?Install PHP on macOS Monterey. brew --version. Installing PHP. ... . brew install php. This will take a while and will produce some output in the Terminal window. ... . command -v php. The command should display something like.. /usr/local/bin/php. or.. /opt/homebrew/bin/php. ... . #!/usr/bin/env php. ... . b) You can include inline scripts in expansions.. How do I run PHP on Mac?Use the Built-In Apache Web Server to Run PHP on Mac
We can use the command sudo apachectl start in the terminal to start the webserver. Then, typing the URL http://localhost/index.php where our PHP file is index. html will run the PHP file. The PHP file should be in the root directory to run.
|