Why install a lower version of PHP?
Since the updated version of Apc,xcache does not keep up with the speed of the PHP version, we need to install a relatively stable PHP low version of the program, and then install other matching extensions.
Start:
New users and user groups
Groupadd WebUser
Useradd-g WebUser WebUser
Download php-5.4
wget http://blog.xinfilm.com/softdir/php-5.4.27.tar.gz
#解包
Tar zxvf php-5.4.27.tar.gz
CD php-5.4.27
./configure--PREFIX=/SERVER/PHP5 \
--enable-sockets \
--WITH-APXS2=/SERVER/APACHE2/BIN/APXS \
--with-mysql=/server/mysql \
--WITH-MYSQLI \
--with-mysqli=/server/mysql/bin/mysql_config \
--with-pdo-mysql=/server/mysql \
--WITH-JPEG-DIR=/USR/LIB64 \
--with-curl \
--enable-mbstring=all \
--WITH-CONFIG-FILE-PATH=/SERVER/PHP5/ETC \
--ENABLE-SOAP \
--with-freetype-dir=/usr/local/lib \
--WITH-GD \
--with-gettext
#编译 and install
Make && make install
Vi/server/apache2/conf/httpd.conf
#增加Addtype Line
AddType application/x-httpd-php. php
CP./php.ini-production/server/php5/etc/php.ini
#编辑include_path
Vi/server/php5/etc/php.ini
include_path = ".:/ Php/includes:/server/php5/lib/php "
Cgi.fix_pathinfo=1
Date.timezone = Asia/shanghai
#启用了selinux的系统需要如下一行操作
Chcon-t texrel_shlib_t/server/apache2/modules/libphp5.so
#重启Apache
/server/apache2/bin/apachectl restart