PHP-FPM 开启慢日志记录
2021-03-04 23:29
标签:cond install vim config 使用 慢日志 set note href 首先,找到 然后找到 打开配置文件: 查找 打开其他位置的配置文件: 查找 创建日志文件: 重启: 或启动: 配置参考:https://www.php.net/manual/zh/install.fpm.configuration.php PHP-FPM 开启慢日志记录 标签:cond install vim config 使用 慢日志 set note href 原文地址:https://www.cnblogs.com/danhuang/p/12910764.htmlphp-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