- wget http://hk1.php.net/distributions/php-5.6.31.tar.gz
- yum groupinstall "Development Tools"
- yum install zlib openssl perl
- yum install httpd httpd-devel
- tar -xf php.tar.gz -C /usr/src
- cd /usr/src/php
- yum install mariadb mariadb-server php-mysql
- 配置
./configure --prefix /usr/local/php56 --with-apxs2=/usr/local/httpd24/bin/apxs --with-config-file-path=/etc/ --with-config-file-scan-dir=/etc/php.d --with-libxml-dir --with-openssl --with-zlib --enable-mbstring --with-mysql
其中php与httpd的联系就是apxs, 与mysql的联系就是with-mysql
- make && make install
- cp php.ini-development /etc/php.ini
- mkdir /etc/php.d/
- 修改httpd.conf