我有一个Symfony 3.4项目和来自旧项目的代码(SF 2.1) - 我想将代码从旧项目迁移到新项目。这些项目都不存在任何服务。
通过运行php bin / 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
已安装的包(作曲家信息):
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
任何想法如何解决?谢谢!
答案 0 :(得分:2)
symfony版本v3.4.7有点坏了,我建议你降级它,暂时不要使用3.4.7版本。
所以你需要使用版本3.4.6或以前的symfony
答案 1 :(得分:1)
看来这是Symfony 3.4.7中的一个问题。降级到Symfony 3.4.6可以解决这个问题。
作为参考,这引入了问题:https://github.com/symfony/symfony/pull/26626并修复了此问题:https://github.com/symfony/symfony/pull/26758