Php SF 3.4:检测到服务的循环参考;“路由.装入器”;

Php SF 3.4:检测到服务的循环参考;“路由.装入器”;,php,symfony,Php,Symfony,我有一个symfony3.4项目和一个旧项目(sf2.1)的代码-我想将代码从旧项目迁移到新项目。这两个项目都不存在任何服务 通过运行PHPBIN/console,我得到了服务“routing.loader”路径“routing.loader”检测到的错误循环引用->什么都不管用 异常跟踪: Symfony\Component\DependencyInjection\Container->get() at /private/var/www/html/treeconsult/test/ve

我有一个symfony3.4项目和一个旧项目(sf2.1)的代码-我想将代码从旧项目迁移到新项目。这两个项目都不存在任何服务

通过运行PHPBIN/console,我得到了服务“routing.loader”路径“routing.loader”检测到的错误循环引用->什么都不管用

异常跟踪:

 Symfony\Component\DependencyInjection\Container->get() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php:56
 Symfony\Bundle\FrameworkBundle\Routing\Router->getRouteCollection() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:363
 Symfony\Component\Routing\Router->getGeneratorDumperInstance() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:328
 Symfony\Component\Routing\Router->Symfony\Component\Routing\{closure}() at n/a:n/a
 call_user_func() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Config/ResourceCheckerConfigCacheFactory.php:43
 Symfony\Component\Config\ResourceCheckerConfigCacheFactory->cache() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:336
 Symfony\Component\Routing\Router->getGenerator() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:240
 Symfony\Component\Routing\Router->generate() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/appDevDebugProjectContainer.php:1444
 ContainerYqoe0c9\appDevDebugProjectContainer->getDebug_FileLinkFormatterService() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/appDevDebugProjectContainer.php:1009
 ContainerYqoe0c9\appDevDebugProjectContainer->getTwigService() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/getAssetic_AssetManagerService.php:21
 require() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/appDevDebugProjectContainer.php:840
 ContainerYqoe0c9\appDevDebugProjectContainer->load() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/getRouting_LoaderService.php:46
 require() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/appDevDebugProjectContainer.php:840
 ContainerYqoe0c9\appDevDebugProjectContainer->load() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:304
 Symfony\Component\DependencyInjection\Container->get() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php:56
 Symfony\Bundle\FrameworkBundle\Routing\Router->getRouteCollection() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:363
 Symfony\Component\Routing\Router->getGeneratorDumperInstance() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:328
 Symfony\Component\Routing\Router->Symfony\Component\Routing\{closure}() at n/a:n/a
 call_user_func() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Config/ResourceCheckerConfigCacheFactory.php:43
 Symfony\Component\Config\ResourceCheckerConfigCacheFactory->cache() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:336
 Symfony\Component\Routing\Router->getGenerator() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Routing/Router.php:240
 Symfony\Component\Routing\Router->generate() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/appDevDebugProjectContainer.php:1444
 ContainerYqoe0c9\appDevDebugProjectContainer->getDebug_FileLinkFormatterService() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/appDevDebugProjectContainer.php:1292
 ContainerYqoe0c9\appDevDebugProjectContainer->getDebug_DebugHandlersListenerService() at /private/var/www/html/treeconsult/test/var/cache/dev/ContainerYqoe0c9/appDevDebugProjectContainer.php:1365
 ContainerYqoe0c9\appDevDebugProjectContainer->ContainerYqoe0c9\{closure}() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:229
 Symfony\Component\EventDispatcher\EventDispatcher->sortListeners() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:61
 Symfony\Component\EventDispatcher\EventDispatcher->getListeners() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php:128
 Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->getListeners() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php:250
 Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->preProcess() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php:134
 Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:961
 Symfony\Component\Console\Application->doRunCommand() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:86
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:248
 Symfony\Component\Console\Application->doRun() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:74
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /private/var/www/html/treeconsult/test/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:148
 Symfony\Component\Console\Application->run() at /private/var/www/html/treeconsult/test/bin/console:27
已安装的软件包(编写器信息):


有没有办法解决这个问题?谢谢

symfony v3.4.7版有点破损,我建议您将其降级,目前不要使用3.4.7版本


因此,您需要使用symfony的3.4.6版或之前版本

这似乎是symfony 3.4.7中的一个问题。降级到Symfony 3.4.6为我解决了这个问题


作为参考,这引入了一个问题:并修复了它:

这仅在我运行
composer update
时有效,而不是
composer install
!当我运行更新时,我不需要删除composer.lock。是的,这是正确的,但是你需要降级你的symfony版本@AntonDachauerGlad来帮助你@安东达肖
composer/ca-bundle                   1.1.1   Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.
doctrine/annotations                 v1.6.0  Docblock Annotations Parser
doctrine/cache                       v1.7.1  Caching library offering an object-oriented API for many cache backends
doctrine/collections                 v1.5.0  Collections Abstraction library
doctrine/common                      v2.8.1  Common Library for Doctrine projects
doctrine/dbal                        v2.7.0  Database Abstraction Layer
doctrine/doctrine-bundle             1.8.1   Symfony DoctrineBundle
doctrine/doctrine-cache-bundle       1.3.3   Symfony Bundle for Doctrine Cache
doctrine/inflector                   v1.3.0  Common String Manipulations with regard to casing and singular/plural rules.
doctrine/instantiator                1.1.0   A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer                       v1.0.1  Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
doctrine/orm                         v2.6.1  Object-Relational-Mapper for PHP
fig/link-util                        1.0.0   Common utility implementations for HTTP links
friendsofsymfony/user-bundle         v2.1.2  Symfony FOSUserBundle
incenteev/composer-parameter-handler v2.1.3  Composer script handling your ignored parameter file
jdorn/sql-formatter                  v1.2.17 a PHP SQL highlighting library
kriswallsmith/assetic                v1.4.0  Asset Management for PHP
monolog/monolog                      1.23.0  Sends your logs to files, sockets, inboxes, databases and various web services
paragonie/random_compat              v2.0.11 PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
psr/cache                            1.0.1   Common interface for caching libraries
psr/container                        1.0.0   Common Container Interface (PHP FIG PSR-11)
psr/link                             1.0.0   Common interfaces for HTTP links
psr/log                              1.0.2   Common interface for logging libraries
psr/simple-cache                     1.0.1   Common interfaces for simple caching
sensio/distribution-bundle           v5.0.21 Base bundle for Symfony Distributions
sensio/framework-extra-bundle        v5.1.6  This bundle provides a way to configure your controllers with annotations
sensio/generator-bundle              v3.1.7  This bundle generates code for you
sensiolabs/security-checker          v4.1.8  A security checker for your composer.lock
swiftmailer/swiftmailer              v5.4.9  Swiftmailer, free feature-rich PHP mailer
symfony/assetic-bundle               v2.8.2  Integrates Assetic into Symfony2
symfony/monolog-bundle               v3.2.0  Symfony MonologBundle
symfony/phpunit-bridge               v3.4.7  Symfony PHPUnit Bridge
symfony/polyfill-apcu                v1.7.0  Symfony polyfill backporting apcu_* functions to lower PHP versions
symfony/polyfill-intl-icu            v1.7.0  Symfony polyfill for intl's ICU-related data and classes
symfony/polyfill-mbstring            v1.7.0  Symfony polyfill for the Mbstring extension
symfony/polyfill-php56               v1.7.0  Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions
symfony/polyfill-php70               v1.7.0  Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-util                v1.7.0  Symfony utilities for portability of PHP codes
symfony/swiftmailer-bundle           v2.6.7  Symfony SwiftmailerBundle
symfony/symfony                      v3.4.7  The Symfony PHP framework
twig/twig                            v2.4.8  Twig, the flexible, fast, and secure template language for PHP