我收到此错误:
FileLoaderLoadException:无法导入资源 “app / config / security.yml”来自“/app/config/config.yml”。
文件security.yml位于正确的路径上。这是我的security.yml文件:
jms_sapp/confiapp/config/security.yml
secure_all_services: false
exprapp/confiapp/config/security.yml
security:
encoders:
Symfony\Component\Security\Core\User\User: plaintext
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
providers:
in_memory:
memory:
users:
user: { password: userpass, roles: [ 'ROLE_USER' ] }
admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
login:
pattern: ^/demo/secured/login$
security: false
secured_area:
pattern: ^/demo/secured/
form_login:
check_path: /demo/secured/login_check
login_path: /demo/secured/login
logout:
path: /demo/secured/logout
target: /demo/
#anonymous: ~
#http_basic:
# realm: "Secured Demo Area"
access_control:
#- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }
#- { path: ^/_internal/secure, roles: IS_AUTHENTICATED_ANONYMOUSLY, ip: 127.0.0.1 }
答案 0 :(得分:1)
正如@Sgoettschkes指出的那样,这三条线在这里显然是有问题的。它们不符合YAML语法标准。我的第二个问题是:你想要用它们实现什么目标?尝试删除它们,我百分之百地确定此错误将消失。
我强烈建议您使用一个好的IDE,它会为您突出显示YAML代码,以防您不使用IDE(我个人使用NetBeans并且它可以很好地处理YAML文件)。这样的语法错误很常见,很容易被发现。