Symfony 4网站,在作曲家更新之后,现在停留在PHP致命错误的更新循环中?

时间:2018-04-21 02:24:35

标签: symfony composer-php

我是Symfony 4.0.8网站。

几天前,一切正常。从那时起,我没有做任何代码或配置更改。

已经运行了许多'作曲家'和'纱线'更新。

目前,我无法更新或访问该网站。

我陷入了" PHP致命错误"作曲家更新循环 - 和,iiuc,自动加载存在问题。

这是我看到的

cat composer.json
    ...
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    ...

composer dump-autoload
    Generating autoload files

composer clear-cache
    Do not run Composer as root/super user! See https://getcomposer.org/root for details
    Cache directory does not exist (cache-vcs-dir): 
    Clearing cache (cache-repo-dir): /root/.composer/cache/repo
    Clearing cache (cache-files-dir): /root/.composer/cache/files
    Clearing cache (cache-dir): /root/.composer/cache

redis-cli flushall
    OK

composer update
        1/1:        http://packagist.org/p/provider-latest$ab716f1fe302ba4a374535db44b1ad22b3e9b9030c6e62892e9a7afac81b8c74.json
        Finished: success: 1, skipped: 0, failure: 0, total: 1
    Do not run Composer as root/super user! See https://getcomposer.org/root for details
    Loading composer repositories with package information
    Updating dependencies (including require-dev)

    Prefetching 7 packages 
      - Downloading (100%)

    Package operations: 7 installs, 0 updates, 0 removals
      - Installing friendsofsymfony/http-cache-bundle (dev-master 6b75eba): Loading from cache
      - Installing snc/redis-bundle (dev-master b133296): Loading from cache
      - Installing solarium/solarium (4.0.0-rc.1): Loading from cache
      - Installing symfony-cmf/block-bundle (dev-master 952b171): Loading from cache
      - Installing symfony-cmf/menu-bundle (dev-master 5c6bd22): Loading from cache
      - Installing symfony-cmf/routing-auto-bundle (dev-master ab9fa1d): Loading from cache
      - Installing symfony-cmf/tree-browser-bundle (dev-master 14ddf7d): Loading from cache
    Writing lock file
    Generating autoload files
    ocramius/package-versions:  Generating version class...
    ocramius/package-versions: ...done generating version class
    Executing script cache:clear [OK]
    Executing script assets:install --symlink --relative public [OK]
    Executing script security-checker security:check [OK]

composer update
    Do not run Composer as root/super user! See https://getcomposer.org/root for details
    Loading composer repositories with package information
    Updating dependencies (including require-dev)
    Package operations: 0 installs, 0 updates, 0 removals
    Writing lock file
    Generating autoload files
    ocramius/package-versions:  Generating version class...
    ocramius/package-versions: ...done generating version class
    Executing script cache:clear [KO]
     [KO]
    Script cache:clear returned with error code 255
    !!  PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "CmfMenuBundle" from namespace "Symfony\Cmf\Bundle\MenuBundle".
    !!  Did you forget a "use" statement for another namespace? in /opt/test/src/Kernel.php:32
    !!  Stack trace:
    !!  #0 /opt/test/vendor/symfony/http-kernel/Kernel.php(403): App\Kernel->registerBundles()
    !!  #1 /opt/test/vendor/symfony/http-kernel/Kernel.php(122): Symfony\Component\HttpKernel\Kernel->initializeBundles()
    !!  #2 /opt/test/vendor/symfony/framework-bundle/Console/Application.php(64): Symfony\Component\HttpKernel\Kernel->boot()
    !!  #3 /opt/test/vendor/symfony/console/Application.php(143): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(S in /opt/test/src/Kernel.php on line 32
    !!  
    Script @auto-scripts was called via post-update-cmd

composer update
    Do not run Composer as root/super user! See https://getcomposer.org/root for details
    Loading composer repositories with package information
    Updating dependencies (including require-dev)
    Package operations: 7 installs, 0 updates, 0 removals
      - Installing friendsofsymfony/http-cache-bundle (dev-master 6b75eba): Loading from cache
      - Installing snc/redis-bundle (dev-master b133296): Loading from cache
      - Installing solarium/solarium (4.0.0-rc.1): Loading from cache
      - Installing symfony-cmf/block-bundle (dev-master 952b171): Loading from cache
      - Installing symfony-cmf/menu-bundle (dev-master 5c6bd22): Loading from cache
      - Installing symfony-cmf/routing-auto-bundle (dev-master ab9fa1d): Loading from cache
      - Installing symfony-cmf/tree-browser-bundle (dev-master 14ddf7d): Loading from cache
    Writing lock file
    Generating autoload files
    ocramius/package-versions:  Generating version class...
    ocramius/package-versions: ...done generating version class
    Executing script cache:clear [OK]
    Executing script assets:install --symlink --relative public [OK]
    Executing script security-checker security:check [OK]

composer update
    Do not run Composer as root/super user! See https://getcomposer.org/root for details
    Loading composer repositories with package information
    Updating dependencies (including require-dev)
    Package operations: 0 installs, 0 updates, 0 removals
    Writing lock file
    Generating autoload files
    ocramius/package-versions:  Generating version class...
    ocramius/package-versions: ...done generating version class
    Executing script cache:clear [KO]
     [KO]
    Script cache:clear returned with error code 255
    !!  PHP Fatal error:  Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "CmfMenuBundle" from namespace "Symfony\Cmf\Bundle\MenuBundle".
    !!  Did you forget a "use" statement for another namespace? in /opt/test/src/Kernel.php:32
    !!  Stack trace:
    !!  #0 /opt/test/vendor/symfony/http-kernel/Kernel.php(403): App\Kernel->registerBundles()
    !!  #1 /opt/test/vendor/symfony/http-kernel/Kernel.php(122): Symfony\Component\HttpKernel\Kernel->initializeBundles()
    !!  #2 /opt/test/vendor/symfony/framework-bundle/Console/Application.php(64): Symfony\Component\HttpKernel\Kernel->boot()
    !!  #3 /opt/test/vendor/symfony/console/Application.php(143): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(S in /opt/test/src/Kernel.php on line 32
    !!
    Script @auto-scripts was called via post-update-cmd

删除/禁用捆绑包不是这里的解决方案 - 同样,最近一切都在运行,所有当前的捆绑包都已安装。

'东西'在那个数量的作曲家/纱线升级正在造成这种情况。

问题是什么?

2 个答案:

答案 0 :(得分:0)

鉴于错误状态“class”CmfMenuBundle“来自命名空间”Symfony \ Cmf \ Bundle \ MenuBundle“”,似乎CmfMenuBundle更新存在某种类型的问题。

修改您的composer.json以指定您的项目应使用以前版本的cmfMenuBundle,然后运行composer install命令,该命令应安装指定的特定版本。

答案 1 :(得分:0)

正如我所提到的,删除/禁用Bundles不是解决方案;捆绑版本显然也无关紧要。

结果问题是当前作曲家发布,v1.6.4。

https://github.com/composer/composer/issues/7268

回到作曲家v1.6.3解决所有问题。