wget cn2.php.net/get/php-5.6.31.tar.gz/from/this/mirror
gzip -d php-5.6.31.tar.gz
tar xvf php-5.6.31.tar
groupadd www
useradd -g www -s /sbin/nologin -M www
su
#./configure \
--prefix=/usr/local/php \
--with-mysql=/usr/local/mysql \
--with-apxs=/usr/local/apache2/bin/apxs \
make
make install
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .php5
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
ServerName 127.0.0.1:80
或
ServerName localhost:80
cp php-5.6.31/php.ini.dist /usr/local/php/lib/php.ini
register_globals = On
service apache restart
rpm -qa php
yum -y install php
chkconfig php on
# Centos 6
rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
#Centos 7
yum install epel-release
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
yum list --enablerepo=remi --enablerepo=remi-php56 | grep php
yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof