简体   繁体   English

禁用php.ini文件中的E_STRICT错误仍然会引发错误

[英]Disable E_STRICT errors in php.ini file still throws the errors

I'm trying to disable E_STRICT errors in my php.ini file but it still throws the error. 我正在尝试禁用php.ini文件中的E_STRICT错误,但仍会引发错误。 I'm using PHP 5.4.10 with a MAMP (not PRO version). 我使用的是带有MAMP PHP 5.4.10 (不是PRO版本)。

With phpinfo I've located the php.ini file in /Applications/MAMP/bin/php/php5.4.10/conf/php.ini 使用phpinfo我已经在/Applications/MAMP/bin/php/php5.4.10/conf/php.ini找到了php.ini文件。

I've changed: 我改变了:

error_reporting = E_ALL

to

error_reporting = E_ALL & ~E_STRICT

Then i've restarted Apache but it still throw the error, where I'm wrong? 然后我重新启动了Apache但是它仍然抛出错误,我在哪里错了?

Use error_reporting = E_ALL ^ E_STRICT . 使用error_reporting = E_ALL ^ E_STRICT

If you didn't have access to php.ini, you could put this in your .htaccess file: 如果您无权访问php.ini,则可以将其放在.htaccess文件中:

php_value error_reporting 30711

This is the E_ALL value (32767) and the removing the E_STRICT (2048) and E_NOTICE (8) values. 这是E_ALL值(32767)并除去E_STRICT(2048)和E_NOTICE(8)值。

If you don't have access to the .htaccess file or it's not enabled, you can put this at the top of the PHP section of any script 如果您无权访问.htaccess文件或未启用该文件,则可以将其放在任何脚本的PHP部分的顶部

error_reporting(E_ALL ^ E_STRICT)

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

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