在mamp中升级php版本

我使用的是最新版本的MAMP服务器.
PHP版本的MAMP设置中,我可以找到最新版本7.1.1,
但是当我运行PHP -v时,我会这样 –
PHP 5.5.14 (cli) (built: Sep  9 2014 19:09:25) 
copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0,copyright (c) 1998-2014 Zend Technologies

我无法升级它.请帮我.

在MAMP / bin / PHP /中没有像PHP5.5.14这样的文件

那是因为它指的是你OSX的预装PHP.您需要将其更改为指向您的MAMP PHP.为此,您需要使用文本编辑器编辑.bash_profile,并将MAMP版本的PHP添加到PATH变量中.

请遵循以下步骤(source):

  1. Within the Terminal,run
vim ~/.bash_profile
  1. Type i and then paste the following at the top of the file:
export PATH=/Applications/MAMP/bin/PHP/PHP7.1.1/bin:$PATH
  1. Hit ESC,Type :wq,and hit Enter

  2. In Terminal,run:

source ~/.bash_profile
  1. In Terminal,type in which PHP again and look for the updated string.
    If everything was successful,It should output the new path to MAMP
    PHP install.

如果它没有输出正确的路径,请尝试关闭终端窗口(完全退出)并再次打开,它应该应用更改.

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...