ref:http://blog.mixu.net/2011/01/04/nginx-php-fpm-and-node-js-install-on-centos-5-5
http://www.systmbx.com/nginx/how-to-install-nginx-with-php-5-3-and-php-fpm-support-on-centos-6
Add repositories for nginx and PHP-fpm
Just add the EPEL and Remi repos:
rpm-Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
Install nginx and PHP-fpm
yum--enablerepo=remiinstall php-fpm nginx
Some other common packages:
yum --enablerepo=remi install mysql mysql-server php-mysql php-common php-gd php-mbstring php-mcrypt php-xml php-gd php-bcmath
yum --enablerepo=remi install php-channel-phpunit php-pear-PhpDocumentor php-phpunit-PHPUnit
Configure php
/etc/php5/cgi/php.ini,[...] cgi.fix_pathinfo = 1
Configure nginx
location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
Start nginx and php5-fpm:
# chkconfig nginx on # /etc/init.d/nginx start # chkconfig php-fpm on # /etc/init.d/php-fpm start