即使使用舊版本的 MacOS,我也已經在 mac 上使用php和mamp一年了,因為如果我在終端上輸入我安裝了MacOS Monterreyphp,我會收到一條訊息:zsh: command not found: php
使用舊版本的 MacOS 我從來沒有遇到過這個問題。
我該如何解決問題?
uj5u.com熱心網友回復:
更新到蒙特里后,我遇到了同樣的問題。經過一番谷歌搜索,我發現 MacOS 不包含 PHP。您需要 Homebrew 才能再次安裝 PHP。
brew install php
https://daily-dev-tips.com/posts/installing-php-on-your-mac/
uj5u.com熱心網友回復:
您可能需要在.bashrc檔案中修復它。
做這個:
打開終端并運行以下命令:
nano ~/.bashrc
然后在.bashrc檔案中添加這一行:
export PATH=$PATH:/usr/share/php/bin
保存并退出 ( ctrl x)
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/342719.html
