Hướng dẫn php command not found
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 Using older versions of MacOS I have never had this problem. How can I solve the problem? leymannx 4,9095 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,4332 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. |