How to install and set php environment variables under Linux: 1. Add "export PATH=$PATH:/usr/local/php/bin"; 2. Set "vim ~/.bashrc"; 3. Tail Add "$PATH:/usr/local/php/bin".
The operating environment of this article: linux5.9.8 system, PHP7.1 version, installed under DELL G3 computer
linux How to set php environment variables?
linux configure php environment variables and install composer
Add the following environment variables:
export PATH=$PATH:/usr/local/php/bin
Permanent configuration
vim ~/.bashrc
Add at the end
export PATH=$PATH:/usr/local/php/bin
Make the configuration effective
source ~/.bashrc
1、下载composer
curl -sS https://getcomposer.org/installer | php
2、将composer.phar文件移动到bin目录以便全局使用composer命令
mv composer.phar /usr/local/bin/composer
3、切换国内源
composer config -g repo.packagist composer https://packagist.phpcomposer.com
4. Enter composer to verify
Successful installation
Recommended learning: "PHP Video Tutorial》
The above is the detailed content of How to set environment variables when installing php under linux. For more information, please follow other related articles on the PHP Chinese website!