我的页面出现错误,但未登录到日志文件
我已经设置了
display_errors:Off
display_startup_errors:Off
error_log:error_log
log_errors:On
配置后我重新启动了apache 但它不起作用
刚刚检查了apache文件/etc/httpd/logs/error_log文件 它包含错误,但为什么 error_log 没有在发生错误的文件夹中创建
最佳答案
在你的 php 文件中尝试这个
ini_set("log_errors", 1);
ini_set("error_log",$_SERVER['DOCUMENT_ROOT']."/logs/php-error.log");
授予logs文件夹及其文件的写入权限,然后检查logs文件夹中的文件。
error_log:error_log
error_log
没有正确的路径,请设置正确的路径,如下所示
log_errors = On
error_log = "C:\xampp\php\logs\php_error_log"
关于PHP 错误日志无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20089856/