且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在MAMP 4.1上更改PHP版本

更新时间:2023-02-22 20:19:56

@Scott在您的问题下的评论中提到:

As mentioned by @Scott in the comments under your question:

您在这里是正确的链接.使用底部答案来重命名 bin/php目录. MAMP首选项窗格将显示最新的2个 php目录中的版本. –斯科特·艾森伯格

Your here is the right link. Use the bottom answer to rename the bin/php directory. The MAMP preference pane will show the 2 latest versions in the php directory. – Scott Eisenberg

该链接的答案是:

如果服务器正在运行,请先停止它.转到"/Applications/MAMP/bin/", 重命名不需要的PHP版本(仅允许MAMP使用2 PHP版本),例如"_php5.2.17".现在MAMP将使用php版本 剩下的.转到MAMP管理器,然后进行设置,然后切换 到您需要的php版本.

First stop the Server if its running. Go to "/Applications/MAMP/bin/", rename the PHP Version you don't need (MAMP is only allowed to use 2 PHP Versions), e.g. "_php5.2.17". Now MAMP will use the php versions that are left. Go to the MAMP Manager and then settings, then switch to the php version you need.

对于我(和您的情况类似),我将名为php7.1.1的文件夹重命名为_php7.1.1,现在MAMP在首选项窗格中显示5.6.307.0.15.

In my case (and similarly yours), I renamed the folder named php7.1.1 to _php7.1.1 and now MAMP shows me 5.6.30 and 7.0.15 in the preferences pane.