Linux centosvmware LAMP php-fpm pool, php-fpm slow execution log, Open_basedir, PHP-FPM process Management

Source: Internet
Author: User
Tags php script

First, the pool of PHP-FPM

vim/usr/local/php/etc/php-fpm.conf//added in [Global] section

Include = etc/php-fpm.d/*.conf

mkdir/usr/local/php/etc/php-fpm.d/

cd/usr/local/php/etc/php-fpm.d/

Vim www.conf//content as follows

[WWW]

Listen =/tmp/www.sock

listen.mode=666

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

Second, php-fpm slow execution log

Continue editing the configuration file

Vim aming.conf//content as follows

[Aming]

Listen =/tmp/aming.sock

listen.mode=666

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

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

/ETC/INIT.D/PHP-FPM restart

Third, Open_basedir

vim/usr/local/php-fpm/etc/php-fpm.d/www.conf//Add the following:

Request_slowlog_timeout = 1

Slowlog =/usr/local/php-fpm/var/log/www-slow.log

Configure Nginx Virtual host test.com.conf, change Unix:/tmp/php-fcgi.sock to Unix:/tmp/www.sock

Reload Nginx Service

Vim/data/wwwroot/test.com/sleep.php//writes the following:

<?php echo "Test slow Log"; sleep (2); echo "Done";? >

Curl-x127.0.0.1:80 test.com/sleep.php

Cat/usr/local/php-fpm/var/log/www-slow.log

Iv. PHP-FPM Process Management

vim/usr/local/php-fpm/etc/php-fpm.d/aming.conf//Add the following:

php_admin_value[open_basedir]=/data/wwwroot/aming.com:/tmp/

Create a test PHP script to test

Change aming.conf again, modify the path, test again

Configuration error Log

Test again

Viewing the error log

Linux centosvmware LAMP php-fpm pool, php-fpm slow execution log, Open_basedir, PHP-FPM process Management

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.