Linux安装PHP

无脑输命令, CentOS 7.2/PHP5.6

1
2
3
4
5
6
7
8
9
10
11
12
13
yum -y install wget
wget http://hk1.php.net/get/php-5.6.36.tar.bz2/from/this/mirror
tar -jxvf php-5.6.36.tar.bz2
cd php-5.6.36
sudo yum -y install autoconf automake libtool re2c flex bison libxml2 libxml2-devel
./configure --profix=/usr/local/php56
make
make test
#Bug #69958
#Bug #70172
make install

环境变量

1
2
3
4
5
6
7
8
9
10
#只对当前登录用户生效
vi ~/.bashrc
export PATH=/usr/local/php56/bin:$PATH
source ~/.bashrc
#所有系统用户生效
vi /etc/profile
PATH=$PATH:/usr/local/php56/bin
export PATH
source /etc/profile