【问题标题】:CakePhp 2.6.3 Not Working on PHP 7CakePhp 2.6.3 不适用于 PHP 7
【发布时间】:2018-02-20 13:14:59
【问题描述】:

致命错误:未捕获的错误:在 /var/www/html/hrportal/lib/Cake/Utility/Debugger.php:340 中找不到类“字符串” 堆栈跟踪:0 /var/www/html/hrportal/lib/Cake/Utility/Debugger.php(742): Debugger::trace(Array)1 /var/www/html/hrportal/lib/Cake/Error/ErrorHandler .php(229): Debugger->outputError(Array) /var/www/html/hrportal/app/Controller/AppController.php(72): ErrorHandler::handleError(8, '未定义索引...', '/ var/www/html/h...', 72, 数组) 3 /var/www/html/hrportal/lib/Cake/Event/CakeEventManager.php(243): AppController->beforeFilter(Object(CakeEvent)) 4 /var/www/html/hrportal/lib/Cake/Controller/Controller.php(676): CakeEventManager->dispatch(Object(CakeEvent)) 5 /var/www/html/hrportal/lib/Cake/Error/ExceptionRenderer。 php(154): Controller->startupProcess() 6 /var/www/html/hrportal/lib/Cake/Error/ExceptionRenderer.php(92): ExceptionRenderer->_getController(Object(FatalErrorException)) 7 /var/www/ html/hrportal/lib/Cake/Error/ErrorHandler.php(126): ExceptionRenderer->__construct(Object(FatalErrorException)) 8 在 /var/www/html/hrportal/lib/Cake/Utility/Debugger.php 上线340

当我将系统升级到 PHP 7.0 时出现此错误。

我有 CakePHP 应用程序,它在 5.5.9 上完美运行, 现在这个错误来了,请帮忙。

【问题讨论】:

  • 我有同样的问题
  • @SandipGhadge 安装 5.6 它会让你工作。

标签: cakephp cakephp-2.0 php-7 apache2.4


【解决方案1】:

CakePHP 2.6 与 PHP 7 不兼容 https://book.cakephp.org/2.0/en/installation.html

【讨论】:

  • 我已经改回 PHP 5.6 然后也不会出错。
  • 搞定了,现在我已经安装了 PHP 5.6 和 PHP 7,当我切换到 PHP 5.6 时它现在工作正常,谢谢
  • @AyushPant 请接受答案以帮助其他人理解它解决了您的问题。
【解决方案2】:

如果您不想使用 3.x,请尝试 cakephp 2.9 版本

【讨论】:

    【解决方案3】:

    根据 Cakephp 2.x 文档。下面是PHP Requirements 用于 Cakephp 2.x

    PHP 5.3.0 或更高版本(CakePHP 2.6 及以下版本支持 PHP 5.2.8 以上)。 CakePHP 2.8.0 及以上版本支持 PHP 7. 使用 PHP 7.1 以上可能需要通过 PECL 安装 mcrypt。请参阅安全性 更多信息。

    【讨论】:

      【解决方案4】:

      对于 PHP 7,您必须使用 2.9.x

      【讨论】:

      • 已经有一个答案正是这个内容。为什么要添加重复项?
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-27
      • 2013-11-20
      • 1970-01-01
      • 2017-02-01
      • 2017-12-09
      • 1970-01-01
      相关资源
      最近更新 更多