简体   繁体   English

即使在php.ini中定义了error_log,也没有php错误文件

[英]no php error file even though error_log is defined in php.ini

i am running php 5.5.20 in my amazon ec2 linux box. 我在我的amazon ec2 linux盒子里运行php 5.5.20。 I have done the following in the terminal 我在终端上做了以下的事情

[root]# cat /etc/php.ini | grep error_log

; server-specific log, STDERR, or a location specified by the error_log
; Set maximum length of log_errors. In error_log information about the source is
;error_log = php_errors.log
;error_log = syslog
error_log = /var/log/httpd/php_errors.log

Note that the error_log directive is not commented out. 请注意, error_log指令未被注释掉。 However, i am facing errors (namely 404 errors, PDO errors etc) in my website but the php_errors.log file is not even being created. 但是,我在我的网站中遇到错误(即404错误,PDO错误等),但是甚至没有创建php_errors.log文件。

I also tried chmod 777 /var/log/httpd/ as well... but even that didn't help 我也试过chmod 777 /var/log/httpd/ ...但即使这样也无济于事

I also checked that log_errors directive is set to On in php.ini settings 我还检查了在php.ini设置中log_errors指令设置为On

Make sure you are editing the correct file. 确保您正在编辑正确的文件。

I've seen EC2 users have php.ini locations like /etc/php5/apache2/php.ini 我见过EC2用户有像/etc/php5/apache2/php.ini这样的php.ini位置

You could also try locate php.ini in your shell. 您也可以尝试在shell中locate php.ini

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM