phpcakephpstrict

Static Standards error after updating to php 5.4.9


I am getting 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 following solutions

Error while Disabling error reporting in CakePHP

Cakephp doesn't work after installing php5-curl package (Unable to locate "Cake" folder as I have baked my project)

Wampserver cakephp 1.3 Strict standards error

How to eliminate php5 Strict standards errors?

PHP 5 disable strict standards error

https://stackoverflow.com/questions/11799085/turn-off-php-strict-standards?lq=1 (Was not able to turn off the errors)

Cleared cake cache, web browser cache, cookies and restarted server after each change. Even tried in private browsing and chrome, firefox, ie also.


Solution

  • I believe this is because this app is built on an older version of CakePHP, which may use some deprecated functions. It'd be awesome if you (or someone else) could upgrade Cake to a new stable branch. As of now try this in your core.php you could remove the E_STRICT from your error reporting:

    i.e go to app/Config/core.php find

    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
    ));