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 php
on the terminal I get a message:zsh: command not found: php
Using older versions of MacOS I have never had this problem.
How can I solve the problem?
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.
I think ZSH won't expand the ~ on PATH. Try this instead: Show activity on this post. Show activity on this post. The command export PATH="$HOME/.composer/vendor/bin:$PATH" will work, but only for your current terminal session.
Trevor did show that according to "dnf provides" the file "chsh" is in package "util-linux-user". Thanks a lot . It works! Really appreciate of that.
If you would like the path to always be available when zsh launches, add PATH="$HOME/.composer/vendor/bin:$PATH" to the bottom of your ~/.zshrc file. Run the zsh command or restart your terminal and laravel will be available in every session you start.
If you receive this error then there is issue with the path.You have to edit the .zshrc file and add this line view source print? view source print? view source print?
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
brew tap shivammathur/php
Choose the PHP version – this example uses 7.4
brew install shivammathur/php/[email protected]
Link the PHP Version
brew link --overwrite --force [email protected]
Restart the Terminal
php -v
I had the same issue after updating to Monterry. After some googling, I find out MacOS doesn't include PHP. You need Homebrew to install PHP again.
brew install php
https://daily-dev-tips.com/posts/installing-php-on-your-mac/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With