简体   繁体   中英

Symfony 2 cache clearing error

My Symfony 2 website has recently been giving me problems when I try to clear the cache. I type the following command in the terminal:

php app/console cache:clear

And get the following error:

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

Any help is appreciated!

This is my security.yml file:

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 }

Try disabling the sicurity for the specified firewall, so try this line:

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

Hope this help

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM