#开始前删除相关程序
yum remove httpd* php*
#添加php53源
wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/5/x86_64/epel-release-5-4.noarch.rpm
wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/5/x86_64/ius-release-1.0-11.ius.centos5.noarch.rpm
rpm -Uvh epel-release-5-4.noarch.rpm
rpm -Uvh ius-release-1.0-11.ius.centos5.noarch.rpm
#安装php53u等……
yum install php53u php53u-pecl-memcache
chkconfig --level 345 php-fpm on
/etc/init.d/php-fpm restart
#修改/usr/local/nginx/conf/fastcgi_params文件添加一行
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#修改/etc/php-fpm.d/www.conf 文件用户和组与nginx相同
; RPM: apache Choosed to be able to access some dir as httpd
user = www
; RPM: Keep a group allowed to write in log dir.
group = www
#在需要解析php的server下添加location
location ~ .*\.php$
{
# root /var/www/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name;
#/var/www/html可以写成$document_root相当如上面root的部分
include fastcgi_params;
}
附上memcache.php