Jump to content
  • Hello visitors, welcome to the Hacker World Forum!

    Red Team 1949  (formerly CHT Attack and Defense Team) In this rapidly changing Internet era, we maintain our original intention and create the best community to jointly exchange network technologies. You can obtain hacker attack and defense skills and knowledge in the forum, or you can join our Telegram communication group to discuss and communicate in real time. All kinds of advertisements are prohibited in the forum. Please register as a registered user to check our usage and privacy policy. Thank you for your cooperation.

    TheHackerWorld Official

三步将Mac系统默认PHP版本切换为MAMP等扩展环境中的PHP版本

 Share


Recommended Posts

1.先查出MAMP下面集成的PHP版本

cd /Applications/MAMP/bin/php

ls -ls

649207-20220818161814141-545021909.png

 

2.编辑修改 .bash_profile 文件(没有.bash_profile 文件的情况下回自动创建)

sudo vim ~/.bash_profile

在文件的最后输入以下信息,然后保存退出

export PATH="/Applications/MAMP/bin/php/php7.2.20/bin:$PATH"

红色的部分就是你要切换的php版本类型(看项目需求选择)

3. 执行以下命令

source .bash_profile 

如果报错的话请先进入 ls ~ 目录再执行,没报错的话证明你已经操作成了。

输入命令:php -v 查看

649207-20220818162257723-251887273.png

 

 

649207-20220818162207456-1674429850.png

 

 图一为未切换前的版本,图二为切换成功的 7.2.20

 

Link to post
Link to comment
Share on other sites

 Share

discussion group

discussion group

    You don't have permission to chat.
    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...