nginx和php-fpm配置
php的配置:
1. vi php-fpm.conf
listen_address 192.168.2.22:9000;
user nobody; 去掉注释
group nobody; 去掉注释
2.allow_clients 192.168.2.22
3.request_terminate_timeout = 0 去掉注释
nginx的配置:
原样:#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
# }
改为:
fastcgi_pass 192.168.2.22:9000;
fastcgi_param CRIPT_FILENAME $document_root$fastcgi_script_name;
总结:listen_address 192.168.2.22:9000; | 127.0.0.1:9000
allow_clients 192.168.2.22; | 127.0.0.1
fastcgi_pass 192.168.2.22:9000; | 127.0.0.1:9000
这三个参数的值必须保持相同
本文出自 “常用文档” 博客,请务必保留此出处http://yujianglei.blog.51cto.com/7215578/1558704
原文地址:http://yujianglei.blog.51cto.com/7215578/1558704