问题
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