将 php 更新到 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
我已经尝试过以下解决方案
Error while Disabling error reporting in CakePHP
Cakephp doesn't work after installing php5-curl package (无法找到“Cake”文件夹,因为我已经烘焙了我的项目)
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 (无法关闭错误)
每次更改后清除蛋糕缓存、Web 浏览器缓存、cookie 并重新启动服务器。甚至在隐私浏览和 chrome、firefox、ie 中也尝试过。
最佳答案
我相信这是因为此应用程序是基于旧版本的 CakePHP 构建的,它可能使用了一些已弃用的功能。 如果您(或其他人)可以将 Cake 升级到新的稳定分支,那就太棒了。 截至目前,在您的 core.php 中尝试此操作,您可以从错误报告中删除 E_STRICT:
即去 app/Config/core.php 找到
Configure::write('Error', array(
'handler' => 'ErrorHandler::handleError',
'level' => E_ALL & ~E_DEPRECATED,
'trace' => true
));
替换为
Configure::write('Error', array(
'handler' => 'ErrorHandler::handleError',
'level' => E_ALL & ~E_STRICT & ~E_DEPRECATED,
'trace' => true
));
关于php - 更新到 php 5.4.9 后静态标准错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14313533/