Php 从symfony 3.3升级到symfony 3.4后出现服务错误
几个月前,我将我的symfony projet版本从3.3升级到了3.4,所有的东西都找到了,但我最近尝试在事件侦听器上添加广告,然后出现了这个错误Php 从symfony 3.3升级到symfony 3.4后出现服务错误,php,symfony,symfony-dependency-injection,Php,Symfony,Symfony Dependency Injection,几个月前,我将我的symfony projet版本从3.3升级到了3.4,所有的东西都找到了,但我最近尝试在事件侦听器上添加广告,然后出现了这个错误 The configuration key "public" cannot be used to define a default value in "/home/pc-dev/Labs/Projets-jebuy/je-buy.com/app/config/services.yml". Allowed keys are "private", "t
The configuration key "public" cannot be used to define a default value in "/home/pc-dev/Labs/Projets-jebuy/je-buy.com/app/config/services.yml". Allowed keys are "private", "tags", "autowire", "autoconfigure", "bind" in /home
/pc-dev/Labs/Projets-jebuy/je-buy.com/app/config/services.yml (which is being imported from "/home/pc-dev/Labs/Projets-jebuy/je-buy.com/app/config/config.yml").
很明显,我没有从中编辑默认的service.yml文件
# default configuration for services in *this* file
_defaults:
# automatically injects dependencies in your services
autowire: true
# automatically registers your services as commands, event subscribers, etc.
autoconfigure: true
# this means you cannot fetch services directly from the container via $container->get()
# if you need to do this, you can override this setting on individual services
public: false
twig.extension:
class: AppBundle\Twig\Extension\MenuExtension
arguments:
- '@doctrine'
tags:
- {name : twig.extension }
# service.extension:
# class: AdminBundle\DependencyInjection\AdminExtension
# arguments: []
# tags: []
为此(因为在symfony 3.4或4中,所有服务默认为私有)
但是当我尝试运行服务器时,我现在遇到了这个错误
The service "templating.loader.cache" has a dependency on a non-existent service "templating.loader.wrapped".
我现在不知道如何解决它,以及template.loder.wrapped服务在哪里。您是否尝试跳过
private:true
config。默认情况下,As服务是私有的。可能是此配置正在覆盖默认的template.loder.wrapped
scope。是的,考虑到默认情况下服务是私有的,我开始跳过此配置,但我仍然有相同的错误尝试使templating.loder.wrapped
公共。我已经检查了容器服务类是Symfony\Component\Templating\Loader\CacheLoader
我没有找到Templating.Loader.wrapped服务我找到了它的类但没有找到服务你能告诉我在哪里找到它吗我正在使用Symfony 3.4如果你还没有解决这个问题看:你有没有尝试跳过private:true
配置。默认情况下,As服务是私有的。可能是此配置正在覆盖默认的template.loder.wrapped
scope。是的,考虑到默认情况下服务是私有的,我开始跳过此配置,但我仍然有相同的错误尝试使templating.loder.wrapped
公共。我已经检查了容器服务类是Symfony\Component\Templating\Loader\CacheLoader
我找不到Templating.Loader.wrapped服务我找到了它的类但不是服务你能告诉我在哪里找到它吗?我正在使用Symfony 3.4如果你还没有解决这个问题,看这个:
The service "templating.loader.cache" has a dependency on a non-existent service "templating.loader.wrapped".