好像我缺少了某些东西,或者说是错误的教义版本。
致命错误:消息为“服务“ gearman.cache.wrapper”的未捕获异常“ Symfony \ Component \ DependencyInjection \ Exception \ ServiceNotFoundException”与不存在的服务“ doctrine_cache.providers.gearman_cache”具有依赖性。在/home/vagrant/Code/backend-symfony-dev/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php中的第58行上
Symfony \ Component \ DependencyInjection \ Exception \ ServiceNotFoundException:服务“ gearman.cache.wrapper”具有对不存在的服务“ doctrine_cache.providers.gearman_cache”的依赖。在/home/vagrant/Code/backend-symfony-dev/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php中的第58行上
我的composer.json要求
"require" : {
"php" : ">=5.3.3",
"symfony/symfony" : "2.7.*",
"doctrine/orm" : "~2.2,>=2.2.3",
"doctrine/doctrine-bundle" : "~1.2",
"twig/extensions" : "~1.0",
"symfony/assetic-bundle" : "~2.3",
"symfony/swiftmailer-bundle" : "~2.3",
"symfony/monolog-bundle" : "~2.4",
"sensio/distribution-bundle" : "~2.3",
"sensio/framework-extra-bundle" : "~3.0",
"sensio/generator-bundle" : "~2.3",
"incenteev/composer-parameter-handler" : "~2.0",
"braincrafted/bootstrap-bundle" : "~2.0",
"twbs/bootstrap" : "3.0.*",
"jquery/jquery" : "1.10.*",
"knplabs/knp-menu-bundle" : "~2.0",
"knplabs/knp-menu" : "~2.0",
"knplabs/knp-paginator-bundle" : "~2.4",
"symfony/debug" : "~2.6",
"symfony/web-profiler-bundle" : "2.6.4",
"friendsofsymfony/user-bundle" : "1.3.5",
"mailgun/mailgun-php": "~1.7.2",
"rollbar/rollbar": "~0.18.2",
"knplabs/knp-snappy-bundle": "^1.4",
"h4cc/wkhtmltopdf-amd64": "^0.12.3",
"liuggio/excelbundle": "^2.1",
"mmoreram/gearman-bundle": "3.0.5"
}
我在appKernel.php的$ bundles中添加了以下内容
new Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(),
new Mmoreram\GearmanBundle\GearmanBundle()
请注意要使用“对于Symfony 2.X版本使用低于4.X的标签”,因此我正在使用3.0.5。我也尝试使用较低版本,但最终还是遇到了与教义相关的错误。我的系统上也安装了Gearman。在我所缺少的内容上有一些标题。
https://github.com/mmoreram/GearmanBundle
https://gearmanbundle.readthedocs.io/en/latest/installation.html