Php-fpm configuration file

Source: Internet
Author: User
Tags website performance
Php-fpm configuration file 1. clear the original configuration file

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

2. edit the configuration file

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

Write the following content

[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 = 5. max_spare_servers = 35pm. max_requests = 500rlimit_files = 1024

3. check whether the configuration file is correct.

/Usr/local/php/sbin/php-fpm-t

4. use multiple pools to add the www1 pool

[Www1] listen =/tmp/php-fcgi.sockuser = php-fpmgroup = php-fpmpm = dynamicpm. max_children = 50pm. start_servers = 20pm. min _spare_servers = 5. max_spare_servers = 35pm. max_requests = 500rlimit_files = 1024 when multiple pools are used, you must listen to the port in the VM configuration file and change the corresponding pool. 5. configure the website performance log and add the following two lines of slowlog =/tmp/www_slow.logrequest_slowlog _ 1

6. restrict nginx access paths

Add the following lines

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.