Disable E_STRICT errors in php.ini file still throws the errors

[亡魂溺海] 提交于 2019-12-08 07:17:30

问题


I'm trying to disable E_STRICT errors in my php.ini file but it still throws the error. I'm using PHP 5.4.10 with a MAMP (not PRO version).

With phpinfo I've located the php.ini file in /Applications/MAMP/bin/php/php5.4.10/conf/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?


回答1:


Use error_reporting = E_ALL ^ E_STRICT.

If you didn't have access to php.ini, you could put this in your .htaccess file:

php_value error_reporting 30711

This is the E_ALL value (32767) and the removing the E_STRICT (2048) and E_NOTICE (8) values.

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

error_reporting(E_ALL ^ E_STRICT)


来源:https://stackoverflow.com/questions/18014871/disable-e-strict-errors-in-php-ini-file-still-throws-the-errors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!