简体   繁体   中英

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. 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?

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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