> /usr/local/php/etc/php-fpm.conf
vim /usr/local/php/etc/php-fpm.conf
把如下内容写入该文件:
[global]pid = /usr/local/php/var/run/php-fpm.pid
error_log = /usr/local/php/var/log/php-fpm.log
[www]
listen = /tmp/qqq.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
slowlog = /tmp/www_slow.log #慢进程记录
request_slowlog_timeout = 1 超过1s
php_admin_value[open_basedir]=/data/www/:/tmp 限制目录
保存配置文件后,检验配置是否正确的方法为:
/usr/local/php/sbin/php-fpm -t
如果出现诸如 “test is successful” 字样,说明配置没有问题。
/etc/init.d/php-fpm -restart