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

How to configure php environment variables in linux

醉折花枝作酒筹
Release: 2023-03-09 10:26:02
Original
5185 people have browsed it

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

2. Add the PHP running directory

export PATH=$PATH:/www/service/php/70/bin //php所在目录
Copy after login

3. Save and exit

:wq
Copy after login

4. Execution takes effect

source /etc/profile
Copy after login

5 , Verification is successful

php -v
Copy after login

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!

Related labels:
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
Latest Issues
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template