rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
增加一个文件/etc/yum.repos.d/alt.ru.repo并添加如下内容:
[CentALT]
name=CentALT Packages for Enterprise Linux 5 - $basearch
baseurl=http://centos.alt.ru/repository/centos/5/$basearch/
enabled=1
gpgcheck=0
安装nginx&php-fpm:
# yum install nginx
# yum install php-fpm
设置自启动:
# chkconfig --level 345 nginx on
# chkconfig --level 345 php-fpm on
配置nginx
# vi /etc/nginx/nginx.conf
在这个文件中加入如下内容就可以解析php了
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html;
include fastcgi_params;
}
启动nginx和php-fpm:
# service nginx start
# service php-fpm start
*********************************************************************************************************************
如果出现“No input file specified”的错误,可以在/etc/nginx/fastcgi_params中加入如下内容
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
*********************************************************************************************************************