12.21 PHP-FPM's Pool
Cd/usr/local/php-fpm/etc
VI php-fpm.conf
Reload and view the service and find the aming.com on the right
cd/usr/local/nginx/conf/vhost/
VI aaa.com.conf, content as follows
If the test.com process is very large, exhausted the process of php-fpm, then there is a new process will be the most time to sweep the wrong 502, because there is no unnecessary process to deal with it, and aming.com site of the PHP-FPM process is not affected, because they are separate
There is an include vhost/*.conf under the nginx.conf, so it is supported under php-fpm.conf.
Cd/usr/local/php-fpm/etc
Look at the contents of the configuration file
Vi/usr/local/php-fpm/etc/php-fpm.conf
Will [www]
[aming.com] content is deleted
Mkdir/usr/local/php-fpm/etc/php-fpm.d
Cd/usr/local/php/etc/php-fpm.d
Vim www.conf//content as follows
Vim aming.conf
/usr/local/php-fpm/sbin/php-fpm-t
/ETC/INIT.D/PHP-FPM restart
PS aux |grep php-fpm
12.22 php-fpm Slow Execution log
PHP Web page is recommended to use LNMP, because you can see the reason for the slow PHP page
Vim/usr/local/php-fpm/etc/php-fpm.d/www.conf
/usr/local/php-fpm/sbin/php-fpm-t
/ETC/INIT.D/PHP-FPM Reload
See if there is no log file generated, the content is empty because there is no more than 1S of execution process
vim/data/wwwroot/test.com/sleep.php
Curl-x127.0.0.1:80 test.com/sleep.php
Prompt error
Viewing log file lookup errors
Vi/usr/local/php-fpm/etc/php.ini
Enter 2 searches/display_errors change display_errors = off to Display_errors = ON, and then see the specific error message on the browser
Then do a curl hint syntax error, comma semicolon has a problem, need to more into the sleep.php configuration file content symbol for the English input method
Run curl again and look at the log, and will tell you where it is slow, the 3rd line is slow, because line 3rd is executed for 2 seconds, is more than 1 seconds
12.23 Open_basedir
Tested under the test.com 3.php
Restart the service and then curl-x127.0.0.1 test.com/3.php, this time is normal
Vi/usr/local/php-fpm/etc/php.ini
Enter 2 Search/display_errors Change display_errors = on to display_errors = off, normal in production can not be changed to ON, because you can not let people know the error message, but to record in the log file
Re-enter the/error_log search to specify its location for the error log
Re-enter/error_reporting to specify its log level
Change the address to wwtest.com before restarting test.com
First check the log file does not exist, do not exist will be generated manually
Restart under:/ETC/INIT.D/PHP-FPM start
Re-access Test
Check the log, log prompt 3.php under test.com, not under wwtest.com
wwtest.com Change to Test.com
Restart under:/ETC/INIT.D/PHP-FPM start
The re-access test test is normal.
12.24PHP-FPM Process Management
If you use dynamic, then the options below will take effect
Cat usr/local/php-fpm/etc/php-fpm.d/www.conf
If you use static, then the selection below it is only Pm.max_children = 50 effective, the others do not take effect.
PS aux |grep php-fpm viewing process
PHP-FPM pool php-fpm Slow execution log open_basedir PHP-FPM process Management