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

王林
Release: 2023-03-04 13:06:02
Original
3347 people have browsed it

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

2, add the following code

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

3, refresh

source ~/.bash_profile
Copy after login

(video tutorial recommendation: php video tutorial )

4. Check the version

php -v
Copy after login

5. Check the binary execution path of the php command

which php
Copy after login

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!

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