Nginx configure php environment: install phpphp-fpmcpetcphp.iniusrlocalphp5.3.22lib modify: usrlocalphp5.3.22etcphp-fpm. confusernobodygroupnobody start php-fpmusrlocalphp5 nginx configure php environment:
Configure the php environment in nginx:
Install php-fpm
Cp/etc/php. ini/usr/local/php5.3.22/lib/
Modify:/usr/local/php5.3.22/etc/php-fpm.conf
User = nobody
Group = nobody
Start php-fpm
/Usr/local/php5.3.22/sbin/php-fpm
Check whether Port 9000 is enabled:
Netstat-ntplu | grep 9000
Configure nginx:
User nobody;
Worker_processes 1;
Server
{
Listen 80;
Server_name localhost;
Location /{
Root html;
Index index.html index.htm index. php;
}
Location ~ \. Php $ {
Root/usr/local/nginx/html/php;
Fastcgi_pass 127.0.0.1: 9000;
Fastcgi_index index. php;
Fastcgi_param SCRIPT_FILENAME/usr/local/nginx/html/php $ fastcgi_script_name;
Include fastcgi_params;
}
}