加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

在mamp中升级php版本

发布时间:2020-12-13 18:15:46 所属栏目: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 GroupZend Engine v2.5.0,Copyright (c) 1998-2014 Z
我使用的是最新版本的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.

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读