在生产中关闭php严格的报告

时间:2013-05-18 02:24:49

标签: apache2 php php-ini

我从php收到这些错误:

Strict Standards: Redefining already defined constructor for class WP_Widget in /home/kyle/WordPressDev/wp-includes/widgets.php on line 93

Strict Standards: Non-static method AisisCore_Loader_AutoLoader::get_instance() should not be called statically in /home/kyle/WordPressDev/wp-content/themes/Aisis-Framework/CoreTheme/Setup.php on line 6

Strict Standards: Accessing static property AisisCore_Template_Builder::$_options as non static in /home/kyle/WordPressDev/wp-content/themes/Aisis-Framework/AisisCore/Template/Builder.php on line 51

Strict Standards: Accessing static property AisisCore_Template_Builder::$_options as non static in /home/kyle/WordPressDev/wp-content/themes/Aisis-Framework/AisisCore/Template/Builder.php on line 69

Strict Standards: Accessing static property AisisCore_Template_Builder::$_options as non static in /home/kyle/WordPressDev/wp-content/themes/Aisis-Framework/AisisCore/Template/Builder.php on line 70

这对于开发环境来说很好,但是我有一个显示这些错误的生产环境,现在我在我的php.ini error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT中设置了然后我重新启动了Apache但是仍然出现相同的错误,同时修复它们很棒,我需要这些错误才能在生产中消失。

3 个答案:

答案 0 :(得分:2)

您应该隐藏生产中用户的所有错误,并记录它们。

为此,请将display_errors设置为Off

display_errors = Off

只需设置error_reporting即可记录所有内容

error_reporting = E_ALL | E_STRICT

答案 1 :(得分:0)

尝试将error_reporting更改为E_ALL & ~(E_DEPRECATED | E_STRICT)

答案 2 :(得分:0)

使用phpinfo()查看运营php.ini的路径。也许系统使用了另一个php.ini