关于 macos:如何在 MAMP 4.1 上更改 PHP 版本 | 珊瑚贝

How to change PHP version on MAMP 4.1


我在我的 Mac 上下载了 MAMP 4.1;默认情况下,我可以使用的唯一 PHP 版本是 7.0.15 和 7.1.1

如何使用 PHP 5.6?

我在这里尝试了解决方案,它说我应该将我不想使用的版本重命名为其他东西。但它对我不起作用。

screenshot

  • 尝试类似 brew install php56 或参考此链接
  • 你这里是正确的链接。使用底部答案重命名 bin/php 目录。 MAMP 首选项窗格将显示 php 目录中的 2 个最新版本。
  • 您包含了指向您正在寻找的答案的链接。”但它对我不起作用”并不能帮助我们回答您的问题。


正如@Scott 在您的问题下的评论中提到的那样:

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. a€” Scott Eisenberg

链接中的答案是:

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.30 和 7.0.15。

  • 有谁知道让 MAMP 一次显示 2 个 PHP 版本的方法?
  • @BertH 到目前为止,当前的 MAMP 版本不允许选择两个以上的 PHP 版本。这就是 MAMP Pro 的用武之地。它允许配置多个虚拟主机(不用说多个 PHP 版本)。


这就是我的”php”文件夹的样子

Current

创建了另一个文件夹”php-versions”并移动了所有版本,并在”php”文件夹中只保留了我想要的两个版本。并重新启动 Mamp,转到版本 ‘5.6.31’

Later

  • 这是一个快速而肮脏的解决方案,也适用于 Windows。


我使用的是 MAMP 4.5 版。我在 httpd.conf:

上更改了 php 版本

1
/Applications/MAMP/conf/apache/httpd.conf

我想要 php7.1 的版本,所以这就是我所做的:

原行:

1
LoadModule php7_module        /Applications/MAMP/bin/php/php7.2.1/modules/libphp7.so

更新行:

1
LoadModule php7_module        /Applications/MAMP/bin/php/php7.1.12/modules/libphp7.so


它对我有用!

  • 重新启动 mamp 后,值将被覆盖。这个对我有用。 stackoverflow.com/questions/16783558/…


来源:https://www.codenong.com/43137191/

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_9238.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?