在一台运行 Apache 和 PHP 5 的 Linux 服务器上,我们有多个带有单独日志文件的虚拟主机。我们似乎无法将 php error_log
分开虚拟主机之间。
在 <Location>
中覆盖此设置的httpd.conf
似乎什么也没做。
有没有办法让单独的php error_logs
每个虚拟主机?
最佳答案
如果有人来看它应该是这样的:
<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/domains/example.com/html
ErrorLog /var/www/domains/example.com/apache.error.log
CustomLog /var/www/domains/example.com/apache.access.log common
php_flag log_errors on
php_flag display_errors on
php_value error_reporting 2147483647
php_value error_log /var/www/domains/example.com/php.error.log
</VirtualHost>
这仅用于开发,因为 display_error
已打开。您会注意到 Apache 错误日志与 PHP 错误日志是分开的。好东西在 php.error.log
中。
在此处查看 error_reporting
键 http://www.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting
关于linux - 每个虚拟主机的error_log?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/176/