标签云

微信群

扫码加入我们

WeChat QR Code

On one Linux Server running Apache and PHP 5, we have multiple Virtual Hosts with separate log files. We cannot seem to separate the php error_log between virtual hosts.

Overriding this setting in the <Location> of the httpd.conf does not seem to do anything.

Is there a way to have separate php error_logs for each Virtual Host?


That's the apache error log, which is separate to the PHP error log (see other comments)

2018年07月19日36分42秒

php's error log defaults to apache's error log.

2018年07月18日36分42秒

relative to what? the directory of the httpd.conf it's written in, or?

2018年07月19日36分42秒

how could this be voted as the best answer ?

2018年07月18日36分42秒

Depending on your config, you may need to manually create the log file and set the owner/group to the same user/group that Apache is using. Apache won't warn you if it can't write to the log file.

2018年07月18日36分42秒

Note that the "error_reporting" value changes with new versions of PHP as they add more error levels. E_ALL = "30719" right now.

2018年07月18日36分42秒

Since "error_reporting" values keep changing and since you can't use PHP constants like "E_ALL" and "E_STRICT" outside of php, this is how you ensure you always have ALL errors logged: php_value error_reporting 2147483647

2018年07月18日36分42秒

Why would you want your log in your public domain space?

2018年07月18日36分42秒

The log file wouldn't be public. /html/ is the public space.

2018年07月18日36分42秒

Can anyone comment on the difference between php_admin_value and php_value?

2018年07月18日36分42秒

This explains the difference: mattiasgeniar.be/2012/02/18/…

2018年07月19日36分42秒

I will check. I just wonder if it is possible to still have apache and php error log separate when we want to give developers a chance to debug their code without giving them the apache error log which might contain other sensitive data.

2018年07月18日36分42秒

Interesting. Does this behavior depend on the path of the error_log file?

2018年07月18日36分42秒

We're talking about the PHP log, not the Apache log here.

2018年07月18日36分42秒