Home>Article>Backend Development> How to configure php environment variables in linux
Setting method: 1. Open the profile configuration file; 2. Execute the "export PATH=$PATH:/path" command to add the PHP running directory; 3. Use the ":wq" command to save the configuration and exit; 4. Execute the "source /etc/profile" command to make the added configuration take effect.
The operating environment of this article: centos7 system, PHP7.1 version, thinkpad t480 computer
linux configuration PHP environment variables
1. Open the configuration file
vim /etc/profile
2. Add the PHP running directory
export PATH=$PATH:/www/service/php/70/bin //php所在目录
3. Save and exit
:wq
4. Execution takes effect
source /etc/profile
5 , Verification is successful
php -v
Recommended learning:php video tutorial
The above is the detailed content of How to configure php environment variables in linux. For more information, please follow other related articles on the PHP Chinese website!