我在 Symfony 2.3 中使用 FOSFacebookBundle,正如与 FOSUserBundle 文档集成中所说的那样。并编辑security.yml
,运行代码,但我得到了错误:
Warning: SessionHandler::write(): Parent session handler is not open in /var/www/my/app/cache/dev/classes.php line 407
所以我给了权限:
sudo chmod 777 -R app/cache
sudo chmod 777 -R app/logs
当我再次登录,然后注销页面时,我得到了同样的错误。
我看到了这个https://github.com/symfony/symfony/issues/5868并更新了 php。
但是这个问题没有解决我不知道为什么?有谁知道请告诉我?
security.yml
security:
encoders:
FOS\UserBundle\Model\UserInterface: sha512
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: ROLE_ADMIN
providers:
chain_provider:
chain:
providers: [fos_userbundle, my_fos_facebook_provider]
fos_userbundle:
id: fos_user.user_provider.username
my_fos_facebook_provider:
id: my.facebook.user
firewalls:
main:
pattern: ^/
fos_facebook:
app_url: "http://apps.facebook.com/xxxx/"
server_url: "http://symfony/app_dev.php/login"
login_path: /login
check_path: /loginFb
default_target_path: /
provider: my_fos_facebook_provider
form_login:
login_path: /login
check_path: /login_check
provider: fos_userbundle
logout: true
anonymous: true
access_control:
- { path: ^/secured/.*, role: [IS_AUTHENTICATED_FULLY] }
- { path: ^/.*, role: [IS_AUTHENTICATED_ANONYMOUSLY] }
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/, role: ROLE_ADMIN }