Home >Backend Development >PHP Problem >How to modify the path of php command line under mac

How to modify the path of php command line under mac

王林
王林Original
2020-08-14 13:34:193333browse

How to modify the path of the php command line under mac: 1. Open the "~/.bash_profile" configuration file; 2. Configure the php binary file path; 3. Execute the "~/.bash_profile" command to make the configuration immediate Take effect.

How to modify the path of php command line under mac

The specific method is as follows:

(Recommended tutorial: php graphic tutorial)

1 , open the configuration file

sudo vim ~/.bash_profile

2, add the following code

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

3, refresh

source ~/.bash_profile

(video tutorial recommendation: php video tutorial )

4. Check the version

php -v

5. Check the binary execution path of the php command

which php

The above is the detailed content of How to modify the path of php command line under 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