function _open should return true to avoid this error. It can not be null or empty whatever we use either database or file. When we use database to store session data, we keep it blank or no Boolean return. that is the main reason for this error. class session_handler{
public function __construct()
{
session_set_save_handler(
array($this, "_open"),
array($this, "_close"),
array($this, "_read"),
array($this, "_write"),
array($this, "_destroy"),
array($this, "_gc")
);
}
public function _open($savePath, $sessionId)
{
return true;
}
public function _close() { }
public function _read($id) { }
public function _write($id, $data) { }
public function _destroy($id) { }
public function _gc($max) { }}It is only for PHP 7. I do not know it is a bug or not. https://stackoverflow.com/questions/34125849/php-7-user-sessions-issue-failed-to-initialize-storage-module |
PHP 7 user sessions issue - Failed to initialize storage module
-
最新LNMP(linux+nginx+mysql+php+laravel)服务器环境配置教程四
通过nginx运行php服务返回phpinfo()信息。
-
windows下如何github ssh 公钥
windows下如何github ssh 公钥
-
如何查看git项目在哪个路径
如何查看git项目在哪个路径
-
使用IntelliJ IDEA 14和Maven创建java web项目
使用IntelliJ IDEA 14和Maven创建java web项目
-
两列布局——左侧宽度固定,右侧宽度自适应的两种方法
关于左侧宽度固定,右侧宽度自适应两列布局的一种很常用的方法我相信大家都知道。就是利用左侧元素浮动,或者绝对定位的方式使其脱离常规文档流,让两个块级元素能够在同一行显示。然后右侧元素 margin-left 的值等于左侧元素宽度,这时右侧元素将紧挨着左侧元素
-
onhashchange监听url,hash变化
onhashchange监听url,hash变化