php慢查询日志和错误日志使用详解 |
本文标签:php慢查询日志,php错误日志 前言 php-fpm 慢日志
cp php-fpm.conf.default php-fpm.conf 默认通过源码包编译安装php目录应在 /usr/local/php 目录下,如果你通过yum或者其他方式安装,不清楚或不知道php具体安装目录,可以使用 find / -name php-fpm.conf or php -i | grep Path ------------------------------------------ [root@xxxx etc]# php -i | grep Path Configuration File (php.ini) Path => /usr/local/php/etc XPath Support => enabled Path to sendmail => /usr/sbin/sendmail -t -i [root@xxxx etc]# 开启慢查询日志
vim /usr/local/php/etc/php-fpm.d/www.conf 不过配置项都一样的,如果你在php-fpm.conf找不到,就去他的同级目录php-fpm.d下面找下吧 。 ; The log file for slow requests ; Default Value: not set ; Note: slowlog is mandatory if request_slowlog_timeout is set ;slowlog = log/$pool.log.slow ; 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 = 0 slowlog 设置慢查询日志的生成目录 php-error 错误日志
开启错误日志
/usr/local/php/etc/php.ini --------------------------- error_reporting = E_ALL & 'E_DEPRECATED & 'E_STRICT display_errors = Off log_errors = On ; Log errors to specified file. PHP's default behavior is to leave this value ; empty. ; http://php.net/error-log ; Example: ;error_log = php_errors.log ; Log errors to syslog (Event Log on Windows). ;error_log = syslog error_log 错误日志的生成目录 最终的结果是error_log = /var/log/php_error.log display_errors = Off error_reporting = E_ALL log_errors = On
到此这篇关于php慢查询日志和错误日志使用详解的文章就介绍到这了,更多相关php慢查询日志和错误日志内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家! |