简体   繁体   English

无法在运行时禁用严格标准错误

[英]Can't disable Strict Standards errors in Runtime

I want to disable all PHP erros or prevent them to be displayed, but Strict Standard errors insist on showing up. 我想禁用所有PHP错误或阻止它们显示,但是严格标准错误坚持显示。

I'm adding this (though two line are redundant) 我要添加此内容(尽管两行是多余的)

ini_set('error_reporting', 0);
ini_set( "display_errors", 0 );
error_reporting(0);

My application is hosted on OpenShift and running PHP 5.4. 我的应用程序托管在OpenShift上并运行PHP 5.4。

EDIT 编辑

Just realized it's not the only kind of error being thrown. 只是意识到这不是引发的唯一错误。 I added a syntax error (omitted a ;) and it showed the error. 我添加了语法错误(省略了;),并显示了错误。

Parse error: syntax error, unexpected ... 解析错误:语法错误,意外...

Taken from https://stackoverflow.com/a/1248996/1027877 取自https://stackoverflow.com/a/1248996/1027877

in your PHP code: 在您的PHP代码中:

ini_set('display_errors', '0');     # don't show any errors...
error_reporting(E_ALL | E_STRICT);  # ...but do log them

You can have this in your htaccess file 您可以在htaccess文件中拥有此文件

php_flag display_errors off

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM