Hi, we just upgraded to WHM 11.40.1 (build 11) and PhP5.4.25 and tried error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT we're still seeing STRICT errors and all of our older website is not working. I am setting this via WHM PhP Configuration editor by the way.
Any other setting to try please?
Hi Guys,
Check this out how to disable E_STRICT Errors in php 5.4
------------------Source from php.net --------------
PHP: Runtime Configuration - Manual
=> Note:
In PHP 5 a new error level E_STRICT is available. Prior to PHP 5.4.0 E_STRICT was not included within E_ALL, so you would have to explicitly enable this kind of error level in PHP < 5.4.0. Enabling E_STRICT during development has some benefits. STRICT messages provide suggestions that can help ensure the best interoperability and forward compatibility of your code. These messages may include things such as calling non-static methods statically, defining properties in a compatible class definition while defined in a used trait, and prior to PHP 5.3 some deprecated features would issue E_STRICT errors such as assigning objects by reference upon instantiation.
---------------------------------------------------
Simple Fix is to add the below error_reporting value just as integer 30711 in the global php.ini file and restart apache server.
error_reporting 30711
You might think why 30711 ? Here we go,
E_ALL equivalent integer value is : 32767 for php 5.4.x
30711 => [ E_ALL ] - E_NOTICE - E_STRICT => Here, by adding error_reporting 30711 , will show you all the errors except E_STRICT and E_NOTICE Errors.
30719 => [ E_ALL - E_STRICT ] => Here, by adding error_reporting 30719 , will show you all the errors except E_STRICT errors.
Likewise you can remove any errors you could.
Now, here is the calculation that might help you,
E_ERROR ===> 1
E_WARNING ===> 2
E_PARSE ===> 4
E_NOTICE ===> 8
E_CORE_ERROR ===> 16
E_CORE_WARNING ===> 32
E_COMPILE_ERROR ===> 64
E_COMPILE_WARNING ===> 128
E_USER_ERROR ===> 256
E_USER_WARNING ===> 512
E_USER_NOTICE ===> 1024
E_STRICT ===> 2048
E_RECOVERABLE_ERROR ===> 4096
E_DEPRECATED ===> 8192
E_USER_DEPRECATED ===> 16384
1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 +256 +512 + 1024 + 2048 + 4096 + 8192 + 16384 = 32767 => E_ALL
AS E_STRICT is now added to E_ALL, If you would require to remove E_STRICT Errors from E_ALL, Addition and Subraction concept.
32767 - 2048 = 30719
E_ALL - E_STRICT = E_ALL without E_STRICT errors.
/usr/local/lib/php.ini => Find error_reporting. Comment the line and add the below line.
error_reporting 30719
Now restart your apache server. Check your domain now to see E_STRICT Errors Vanished !!!