posted by admin
on Wed, 09/11/2013 - 10:14
Before getting started with nginx, it is recommended that you update PHP to the latest version.
Create a /etc/yum.repos.d/nginx.repo with the following content:
[nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=0 enabled=1
We are going to use php-fpm package to handle PHP fast-cgi.
# yum install nginx # yum install php-fpm
Edit the /etc/nginx/conf.d/default file, and add the following:
location ~ \.php$ { include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; }
Start the service.
# service php-fpm start # service nginx start
Comments
Add new comment