php - 更新到 php 5.4.9 后静态标准错误

标签 php cakephp strict

将 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/

相关文章:

php - 您的 SQL 语法有错误; - 和 undefined variable 错误 - 可能已连接

php - 如何在大型mysql数据库中为十个站点选择不同的记录

cakephp - 我们如何在自定义助手中访问 htmlhelper?

javascript - jQuery 回调 - 严格违反

关于 var 声明的 JavaScript 行为解释

javascript - 使用 "use strict"和可变范围

php - 检查 Timber 中是否存在 Twig 模板

unit-testing - CakePHP/Jenkins/Phing-运行所有单元测试

php - Cakephp 是容器还是树?

php - 仅当重新初始化继承类中的实例变量时,PHP 中使用单例模式的类继承才有效。但为什么?