【问题标题】:Symfony 5 Project: Exception has occurred. ReflectionException: Function include() does not existSymfony 5 项目:发生异常。 ReflectionException: 函数 include() 不存在
【发布时间】:2021-06-20 23:12:39
【问题描述】:

无论我在项目中调用什么,我都会收到此错误。没有 Xdebug 就没有问题。当我打开 Xdebug 时,我总是得到:

发生了异常。 ReflectionException: 函数 include() 不存在

这是给出错误的行:

$caller = isset($frame['class']) ? new \ReflectionMethod($frame['class'], $frame['function']) : new \ReflectionFunction($frame['function']);

ExceptionCaster.php。这是一个 Symfony 文件,不是我自己的。

我用:

Symfony 5.1.8
PHP 8.0.2 (cli) (built: Feb 23 2021 15:14:20) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.2, Copyright (c), by Zend Technologies
    with Xdebug v3.0.3, Copyright (c) 2002-2021, by Derick Rethans

我调用的路线是这样的:

manage_article:
   path:      /manage_article
   defaults:  { _controller: \App\Controller\ManageArticleController::manageArticleAction }

Xdebug 与 PHP 8 不兼容吗?还是使用我的 Symfony 版本?或者还有什么问题?

【问题讨论】:

标签: php symfony xdebug


【解决方案1】:

Xdebug 3.0.x 与 PHP 8.0(以及 PHP 7.2-7.4)兼容。

【讨论】:

    【解决方案2】:

    我解决了这个问题。 一旦我删除独白包,一切都会按预期工作。

    希望这将在未来得到解决。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-06-22
      • 2021-06-12
      • 2015-12-15
      • 1970-01-01
      • 1970-01-01
      • 2021-10-23
      • 2022-08-17
      • 2021-11-19
      相关资源
      最近更新 更多