【发布时间】:2017-05-24 20:01:25
【问题描述】:
我正在尝试在 Symfony 3 (http://symfony.com/doc/current/doctrine/pdo_session_storage.html) 中配置会话,但出现此错误:
Error: session_start(): Failed to initialize storage module: user (path: )
500 Internal Server Error - FatalErrorException
Stack Trace
in var/cache/dev/classes.php at line 113
110. if (ini_get('session.use_cookies') && headers_sent($file, $line)) {
111. throw new \RuntimeException(sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.', $file, $line));
112. }
113. if (!session_start()) {
114. throw new \RuntimeException('Failed to start the session');
115. }
116. $this->loadSession();
你有什么想法,为什么会发生?
【问题讨论】:
-
您是否将会话保存路径检查到 ini 文件中,它没有被注释?
-
是的,我查过了,设置为 session.save_path = /tmp phpinfo() 也确认了。
-
您检查过 PDO 连接吗?连接了吗?
-
是的,我已经检查过了,我已经尝试从脚本创建表格
-
仅供参考,我正在使用 docker php-fpm(我在这个容器中进行的所有 symfony/php 配置)+ docker mariadb(使用套接字,也可以从 php-fpm 访问套接字文件容器),也许这将有助于更好地了解环境。 PHP-FPM - 7.1.0,Mariadb - 10.1.13