ErrorException: 警告: ini_set(): 会话处于活动状态.您此时无法在/../../中更改会话模块的 ini 设置

问题描述:

我正在尝试创建自己的身份验证提供程序,例如 http://symfony.com/doc/current/cookbook/security/custom_authentication_provider.html.

I am trying to create my own authentication provider like in http://symfony.com/doc/current/cookbook/security/custom_authentication_provider.html.

但是,它一直在说:

ErrorException:警告:ini_set():会话处于活动状态.您此时无法在/../../vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php line 56

ErrorException: Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in /../../vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeFileSessionHandler.php line 56

Symfony2 会话在启用会话自动启动"时将无法正常工作.所以请确保它已禁用.

Symfony2 sessions will not work properly with "session auto start" enabled. So make sure that's disabled.

确保您的 php 配置 php.ini 已配置:session.auto_start = 0.

Make sure your php configuration php.ini has this configured: session.auto_start = 0.

或者,如果您无法编辑 php.ini 文件,您可以将 php_flag session.auto_start 0 添加到您的 .htaccess 文件中.

Or you can add php_flag session.auto_start 0 to your .htaccess file if you can not edit the php.ini file.