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

How to set the default php version on mac

王林
Release: 2023-03-06 08:34:02
Original
3288 people have browsed it

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
Copy after login

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版本路径
Copy after login

Save and reload the environment variable

source ~/.bash_profile
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template