更新到Symfony 3.0时找不到类“Appkernel”

时间:2016-03-28 19:58:33

标签: php symfony

我尝试将我的代码和结构更新为Symfony 3.0。做通常的作曲家更新,当作曲家执行post-update-cmd时,我遇到了这个错误:

    Fatal error: Class 'AppKernel' not found in C:\wamp\www\tharmofos\bin\console on line 20

Call Stack:
    0.0002     235192   1. {main}() C:\wamp\www\tharmofos\bin\console:0


Fatal error: require_once(): Failed opening required 'C:\wamp\www\tharmofos\vendor\jms\security-extra-bundle\Tests\Functiona
l/../../vendor/autoload.php' (include_path='.;C:\php\pear') in C:\wamp\www\tharmofos\vendor\jms\security-extra-bundle\Tests\
Functional\AppKernel.php on line 5

Call Stack:
    0.0002     235192   1. {main}() C:\wamp\www\tharmofos\bin\console:0
    0.0249    1144472   2. Symfony\Component\Debug\ErrorHandler::handleFatalError() C:\wamp\www\tharmofos\vendor\symfony\sym
fony\src\Symfony\Component\Debug\ErrorHandler.php:0
    0.0263    1162640   3. Symfony\Component\Debug\ErrorHandler->handleException() C:\wamp\www\tharmofos\vendor\symfony\symf
ony\src\Symfony\Component\Debug\ErrorHandler.php:600
    0.0292    1260456   4. Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler->handleError() C:\wamp\w
ww\tharmofos\vendor\symfony\symfony\src\Symfony\Component\Debug\ErrorHandler.php:530
    0.0292    1262144   5. Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler->getClassCandidates() C:
\wamp\www\tharmofos\vendor\symfony\symfony\src\Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler.php:
62
    2.5849    1595232   6. Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler->findClassInPath() C:\wa
mp\www\tharmofos\vendor\symfony\symfony\src\Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler.php:118

    2.6446    1600616   7. Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler->convertFileToClass() C:
\wamp\www\tharmofos\vendor\symfony\symfony\src\Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler.php:
143
    2.6453    1642120   8. require_once('C:\wamp\www\tharmofos\vendor\jms\security-extra-bundle\Tests\Functional\AppKernel.p
hp') C:\wamp\www\tharmofos\vendor\symfony\symfony\src\Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandl
er.php:188

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated wit
h an exception


  [RuntimeException]
  An error occurred when executing the ""cache:clear --no-warmup"" command:
  Fatal error: Class 'AppKernel' not found in C:\wamp\www\tharmofos\bin\console on line 20
  Call Stack:
      0.0002     235192   1. {main}() C:\wamp\www\tharmofos\bin\console:0
  Fatal error: require_once(): Failed opening required 'C:\wamp\www\tharmofos\vendor\jms\security-extra-bundle\Tests\Func
  tional/../../vendor/autoload.php' (include_path='.;C:\php\pear') in C:\wamp\www\tharmofos\vendor\jms\security-extra-bun
  dle\Tests\Functional\AppKernel.php on line 5
  Call Stack:
      0.0002     235192   1. {main}() C:\wamp\www\tharmofos\bin\console:0
      0.0249    1144472   2. Symfony\Component\Debug\ErrorHandler::handleFatalError() C:\wamp\www\tharmofos\vendor\symfon
  y\symfony\src\Symfony\Component\Debug\ErrorHandler.php:0
      0.0263    1162640   3. Symfony\Component\Debug\ErrorHandler->handleException() C:\wamp\www\tharmofos\vendor\symfony
  \symfony\src\Symfony\Component\Debug\ErrorHandler.php:600
      0.0292    1260456   4. Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler->handleError() C:\w
  amp\www\tharmofos\vendor\symfony\symfony\src\Symfony\Component\Debug\ErrorHandler.php:530
      0.0292    1262144   5. Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler->getClassCandidates
  () C:\wamp\www\tharmofos\vendor\symfony\symfony\src\Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHa
  ndler.php:62
      2.5849    1595232   6. Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler->findClassInPath()
  C:\wamp\www\tharmofos\vendor\symfony\symfony\src\Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandl
  er.php:118
      2.6446    1600616   7. Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler->convertFileToClass
  () C:\wamp\www\tharmofos\vendor\symfony\symfony\src\Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHa
  ndler.php:143
      2.6453    1642120   8. require_once('C:\wamp\www\tharmofos\vendor\jms\security-extra-bundle\Tests\Functional\AppKer
  nel.php') C:\wamp\www\tharmofos\vendor\symfony\symfony\src\Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatal
  ErrorHandler.php:188

截至目前,我尝试删除供应商文件夹并进行了编辑器安装,但我一直收到此错误。 当我尝试访问我的网站时,我收到此错误:

Fatal error: Class 'Symfony\Bundle\FrameworkBundle\FrameworkBundle' not found in C:\wamp\www\tharmofos\app\AppKernel.php on line 11

我认为这是结构更新的问题。

你有任何线索吗?

2 个答案:

答案 0 :(得分:2)

我发现如何通过在composer.json中自动加载AppKernel.php来摆脱这个错误:https://github.com/symfony/symfony-standard/issues/868

答案 1 :(得分:0)

如果可以提供帮助,我经常忘记在升级项目时升级Symfony标准文件(如app / console,web / app.php,web / app_dev.php,app / config / routing_dev.yml ...)到3.0。

导致此错误。