从内部代码启用display_errors [英] Enabling display_errors from inside code

查看:249
本文介绍了从内部代码启用display_errors的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的开发服务器在PHP 5.3的最新更新中遇到了一些配置不匹配的问题,现在我看不到任何错误–每当我遇到致命/解析错误时,我只会看到空白页.

Our development server has suffered some configuration mismatch on recent update to PHP 5.3, and now I can't see any errors – any time I hit a fatal/parse error, I just see a blank page.

现在,我知道如何在正常情况下启用错误报告,但我无权访问php.ini,并且如果页面遇到解析错误,ini_set('display_errors', 1)显然不会将其剪切.

Now, I know how to enable error reporting in normal cases, but I don't have access to php.ini and ini_set('display_errors', 1) obviously doesn't cut it if the page has hit a parse error.

还有其他方法可以通过.htaccess设置/覆盖php.ini的设置吗?

Is there any other way to set / override php.ini's settings, via .htaccess perhaps?

推荐答案

是的,在.htaccess中,您可以输入:

Yes, in .htaccess, you can put:

php_value display_errors 1

...只要没有人将以下内容放在非htaccess的Apache配置文件中:

...As long as no one has put the following in a non-htaccess Apache config file:

php_admin_value display_errors 0

有关更多信息,请参见此处.

See here for more info.

这篇关于从内部代码启用display_errors的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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