Static standards error after upgrading to php 5.4.9

I get the following errors after updating php to version 5.4

Strict Standards: Non-static method Debugger::invoke() should not be called statically, assuming $this from incompatible context in /usr/share/php/cake/libs/debugger.php on line 575 Strict Standards: Non-static method Debugger::getInstance() should not be called statically, assuming $this from incompatible context in /usr/share/php/cake/libs/debugger.php on line 575 

I have already tried the following solutions

Error disabling error reporting in CakePHP

Cakephp does not work after installing the php5-curl package (Could not find the "Cake" folder because I baked my project)

Wakeserver cakephp 1.3 Severe Standards Error

How to fix strict php5 standard errors?

PHP 5 disables strict standard error

https://stackoverflow.com/questions/11799085/turn-off-php-strict-standards?lq=1 (Failed to disable errors)

Cleared cache cache, web browser cache, cookies, and a restarted server after each change. Even tried in a private browser and chrome, firefox, i.e. Also.

+6
source share
2 answers

I believe this is due to the fact that this application is built on an older version of CakePHP, which may use some deprecated features. It would be great if you (or someone else) could upgrade Cake to a new stable branch. For now, try this in your core.php, you can remove E_STRICT from the error message:

Log in to the /Config/core.php find application

 Configure::write('Error', array( 'handler' => 'ErrorHandler::handleError', 'level' => E_ALL & ~E_DEPRECATED, 'trace' => true )); 

replace it as

 Configure::write('Error', array( 'handler' => 'ErrorHandler::handleError', 'level' => E_ALL & ~E_STRICT & ~E_DEPRECATED, 'trace' => true )); 
+8
source

Changing the error_reporting function allows you to fix this. However, cakephp seems to set these flags in several places, so the solution may not have worked for you (I went through the same thing)

Search the source for error_reporting to find it in multiple files. Add the flag "~ E_STRICT", wherever you are. For instance:

 error_reporting(E_ALL & ~E_STRICT & ~E_DEPRECATED); 

You will see it in places like /cake/bootstrap.php,/cake/libs/configure.php,/cake/console/cake.php, etc. I just changed them all to exclude E_STRICT and the problem was fixed.

+3
source

All Articles