标签:cond install vim config 使用 慢日志 set note href
首先,找到 php-fpm
所在的目录:
which php-fpm
whereis php-fpm
然后找到 php-fpm.conf
所在的目录:
ps -ef | grep php-fpm
打开配置文件:
vim /etc/opt/rh/rh-php71/php-fpm.conf
查找 slow
内容,如果没有,看看是否加载了其他位置的配置文件:
include=/etc/opt/rh/rh-php71/php-fpm.d/*.conf
打开其他位置的配置文件:
vim /etc/opt/rh/rh-php71/php-fpm.d/www.conf
查找 slow
内容并启用配置:
; The log file for slow requests
; Default Value: not set
; Note: slowlog is mandatory if request_slowlog_timeout is set
slowlog = /var/opt/rh/rh-php71/log/php-fpm/www-slow.log
; The timeout for serving a single request after which a PHP backtrace will be
; dumped to the ‘slowlog‘ file. A value of ‘0s‘ means ‘off‘.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
request_slowlog_timeout = 1
创建日志文件:
mkdir -p /var/opt/rh/rh-php71/log/php-fpm/www-slow.log
重启:
kill -USR2 `cat /usr/local/php/var/run/php-fpm.pid`
或启动:
/usr/local/bin/php-fpm
配置参考:https://www.php.net/manual/zh/install.fpm.configuration.php
标签:cond install vim config 使用 慢日志 set note href
原文地址:https://www.cnblogs.com/danhuang/p/12910764.html