user = php-fpm
group = php-fpm
pm = dynamic
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 500
rlimit_files = 1024
slowlog=/tmp/www_slow.log
request_slowlog_timeout=1 #将脚本执行超过1秒的记录在路径下,以备调优
php_admin_value[open_basedir]=/data/www/:/tmp/ #针对php的解析,和apache一样设置openbasedir
此处定义的listen = /tmp/www.sock 要和nginx里的虚拟主机配置文件相一致。
#fastcgi_pass unix:/tmp/www.sock;
此外还可以再加入一个pool的模块
[www1]
listen = /tmp/www1.sock
user = php-fpm
group = php-fpm
pm = dynamic
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 500
rlimit_files = 1024
listen段的sock要有区别,这样的话不同的网站可以使用不同的sock。
Ubuntu 14.04下apt-get方法安装LNMP环境
CentOS 7源码编译安装PHP5.6和Nginx1.7.9及MySQL(搭建LNMP环境)