Home>Article>Backend Development> How to set the default php version on mac

How to set the default php version on mac

王林
王林 Original
2020-09-28 15:45:51 3207browse

How to set the default php version under mac: 1. Create a new [.bash_profile] file; 2. Set the default php version in the new file, such as [export PATH=/bin:$PATH]; 3 , execute the [source ~/.bash_profile] command.

How to set the default php version on mac

Specific method:

(Recommended tutorial:php video tutorial)

Create a new one. bash_profile file and edit it

vim ~/.bash_profile

Then enter the php version you want inside

export PATH=/Applications/MAMP/bin/php/php7.2.7/bin:$PATH #/Applications/MAMP/bin/php/php7.2.7/bin是我的php版本路径

Save and reload the environment variable

source ~/.bash_profile

Related recommendations:php training

The above is the detailed content of How to set the default php version on mac. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn