Original: http://www.cnblogs.com/xiaozong/p/5724984.html
--------------------------------------------------------------------------------------------------------------- ----
Php-fpm.conf is a unique configuration file for PHP-FPM
PHP.ini is therefore a required configuration file in PHP mode
The difference is that php-fpm.conf is the configuration file for the PHP-FPM process Manager, PHP.ini is the PHP parser configuration file
There are also/fpm.d/www.conf configuration files in the PHP version of the configuration file path
This is an extension file for the php-fpm.conf configuration file that you can open php-fpm.conf file to view
; include=fpm.d/*.conf
We can use php-fpm.conf to configure slow logs
We can turn on the slow log function.
slowlog = /usr/local/var/log/php-fpm.log.slowrequest_slowlog_timeout = 5s
When a request takes more than 5 seconds, the corresponding record is recorded in the slow log, notice that the time 5s above, the unit can not be ignored, the corresponding other units, M points, H (of course, this is too ridiculous)
php-fpm Slow log will record the process number, the script name, which file which line of code which function execution time is too long :
[21-Nov-2016 10:30:38] [pool www] pid 11877
script_filename = /var/www/ceshi/c.php
[0xb70fb88c]< Span class= "PLN" > sleep () /var/www/ceshi/c.php< Span class= "PLN" >< Span class= "PLN" >< Span class= "PLN" >< Span class= "PLN" >:2
with the log , we know that the Sleep function on line 2nd is a bit problematic, so we can track the problem .
More configuration, which will be summarized later.
PHP.ini and php-fpm.conf configuration file differences