php-fpm配置文件

WBOY
Release: 2016-06-20 12:27:20
Original
1069 people have browsed it

1、清空原自带的配置文件

>  /usr/local/php/etc/php-fpm.conf

2、编辑配置文件

vim /usr/local/php/etc/php-fpm.conf

写入以下内容

[global]pid = /usr/local/php/var/run/php-fpm.piderror_log = /usr/local/php/var/log/php-fpm.log[www]listen = /tmp/php-fcgi.sockuser = php-fpmgroup = php-fpmpm = dynamicpm.max_children = 50pm.start_servers = 20pm.min_spare_servers = 5pm.max_spare_servers = 35pm.max_requests = 500rlimit_files = 1024
Copy after login

3、检查配置文件是否正解

/usr/local/php/sbin/php-fpm -t

4、使用多个池,增加www1池

[www1]listen = /tmp/php-fcgi.sockuser = php-fpmgroup = php-fpmpm = dynamicpm.max_children = 50pm.start_servers = 20pm.min_spare_servers = 5pm.max_spare_servers = 35pm.max_requests = 500rlimit_files = 1024使用多个池需要在虚拟主机配置文件中监听端口也更改相应的池5、配置网站性能日志加入以下两行slowlog = /tmp/www_slow.logrequest_slowlog_timeout =1
Copy after login

6、对nginx访问路径进行限制

加入以下行

php_admin_value[open_basedir]=/usr/local/nginx/html:/tmp

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!