Symfony 2缓存清除错误

时间:2016-11-29 14:13:52

标签: php symfony caching cache-control

当我尝试清除缓存时,我的Symfony 2网站最近给了我一些问题。我在终端中输入以下命令:

php app/console cache:clear

并收到以下错误:

[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
No authentication listener registered for firewall "dev".

感谢任何帮助!

2 个答案:

答案 0 :(得分:0)

这是我的security.yml文件:

security:
encoders:
    FOS\UserBundle\Model\UserInterface: bcrypt

role_hierarchy:
    ROLE_USER:       ROLE_USER
    ROLE_SUPER_ADMIN: ROLE_ADMIN

providers:
    fos_userbundle:
        id: fos_user.user_provider.username

firewalls:
    dev:
        pattern:  ^/(css|images|js)/
    main:
        pattern: ^/
        form_login:
            provider: fos_userbundle
            csrf_provider: security.csrf.token_manager # Use form.csrf_provider instead for Symfony <2.4
            success_handler: Redirectionpages

        logout:      

            success_handler: Redirectionpages
        anonymous:    true

access_control:
    - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
    - { path: ^/admin/, role: ROLE_ADMIN }

答案 1 :(得分:0)

尝试禁用指定防火墙的成熟度,请尝试以下行:

dev:
    pattern:  ^/(css|images|js)/
    security: false

希望这个帮助