Home >Backend Development >PHP Problem >Where is the php log?
This can be configured in php.ini.
Check these settings in php.ini:
error_reporting = E_ALL | E_STRICT (Follow the development recommendations in php.ini) error_log = /var/log/php_errors.log
PHP configuration log:
error_reporting = E_ALL ;将会向PHP报告发生的每个错误 display_errors = Off ;不显示满足上条 指令所定义规则的所有错误报告 log_errors = On ;决定日志语句记录的位置 log_errors_max_len = 1024 ;设置每个日志项的最大长度 error_log = E:/php_log/php_error.log ;指定产生的 错误报告写入的日志文件位置
Then create the log file manually
touch /var/log/php_errors.log chown www-data: /var/log/php_errors.log chmod +rw /var/log/php_errors.log
Now you can view PHP errors this way
tail /var/log/php_errors.log
Recommendation: php server
The above is the detailed content of Where is the php log?. For more information, please follow other related articles on the PHP Chinese website!