Home>Article>Backend Development> How to configure php environment variables in linux

How to configure php environment variables in linux

醉折花枝作酒筹
醉折花枝作酒筹 Original
2021-04-06 14:57:54 4827browse

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.

How to configure php environment variables in linux

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!

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