PHP不显示错误,即使display_errors设置=开 [英] PHP not displaying errors even though display_errors = On

查看:717
本文介绍了PHP不显示错误,即使display_errors设置=开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个PHP 5的Apache2跑在我设置php.ini中一个Ubuntu的服务器的error_reporting = E_ALL | E_STRICT 的error_reporting = E_ALL | E_STRICT ,但是PHP仍然没有显示错误消息。我还使用Apache的虚拟主机。

I have a Ubuntu server running Apache2 with PHP 5. In the php.ini I set error_reporting = E_ALL | E_STRICT and error_reporting = E_ALL | E_STRICT, but PHP is still not displaying error messages. I'm also using Apache virtual hosts.

此外,什么是最严格的错误报告PHP5.3所提供的?我希望我的code为先进的日期和面向未来的越好。

Also, what is the most strict error reporting PHP5.3 has to offer? I want my code to as up-to-date and future-proof as possible.

推荐答案

您还需要确保你有你的php.ini里以下一组设置:

You also need to make sure you have inside your php.ini the following set set:

display_errors = On

或错误,只会去那是默认设置或指定虚拟主机的配置日志。

Or errors will go only to the log that is set by default or specified in the virtual host's configuration.

在php.ini文件是为您的服务器上的所有PHP的基础设置,但这些都可以easilybe覆盖,alterd在PHP code的任何地方,影响了之后改变一切。这发生在一个框架。一个好的检查是对的display_errors添加到您的php.ini。如果您没有看到错误,而是一个被记录下来,在文件的顶部插入这会导致错误:

The php.ini file is where base settings for all php on your server, however these can easilybe overridden and alterd any place in the PHP code and affect everything following that change. This happens a in frameworks. A good check is to add the display_errors to you php.ini. If you don't see an error, but one is being logged, insert this at the top of the file causing the error:

ini_set('display_errors', 1); 
error_reporting(E_ALL);

如果这个工程前面的东西,然后在你的code为禁用错误显示。

If this works then something earlier in your code is disabling error display.

这篇关于PHP不显示错误,即使display_errors设置=开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆