编译安装PHP使用session_start()时报错&解决办法

系统上的PHP是编译安装的,在session_start()的时候报错!

A 错误信息:

Warning: session_start(): open(/var/lib/php/session/sess_qavhhacl7lrdbggauasf1qdlo5, O_RDWR) failed: No such file or directory (2) in /www/tool/classes/service/User.php on line 75

1
Warning: Unknown: open(/var/lib/php/session/sess_qavhhacl7lrdbggauasf1qdlo5, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0

B 查看php.ini:

session.save_path = "/var/lib/php/session" // session的存放路径

所以上面的文字是提示没有该目录

C 解决问题:

创建上面的目录

mkdir session

chmod -R 777 session

再次运行程序就OK了

D 查看更多:

(1)

pwd
/var/lib/php/session
?  session  ls
sess_qavhhacl7lrdbggauasf1qdlo5

(2)

用firebug查看cookie:

PHPSESSID qavhhacl7lrdbggauasf1qdlo5 // php.ini session.name = PHPSESSID

编译安装PHP使用session_start()时报错&解决办法

时间: 2024-12-25 23:12:17

编译安装PHP使用session_start()时报错&解决办法的相关文章

linux 编译安装php及编译安装mysql常见错误总结及解决办法

一.编译安装php常见错误总结及解决办法 错误 1checking for xml2-config path…configure: error: xml2-config not found. Please check your libxml2 installation.解决办法:# yum -y install libxml2-devel 错误 2 checking for BZip2 in default path… not foundconfigure: error: Please rein

Linux(CentOS6.5)下编译安装PHP5.6.22时报错”configure: error: ZLIB extension requires gzgets in zlib”的解决方式(确定已经编译安装Zlib,并已经指定Zlib路径)

本文地址http://comexchan.cnblogs.com/,作者Comex Chan,尊重知识产权,转载请注明出处,谢谢!   今天在CentOS6.5下编译安装PHP时,一直报错 configure: error: ZLIB extension requires gzgets in zlib 而Zlib确定已经安装了. 使用Google根本搜索不到有关的错误. 尝试重新编译了Zlib,还是不行. 后面发现我的PHP编译选项里面有个 --with-libdir=lib64 \ 删除之,再

centos7.2编译安装mysql5.7.21报错解决

编译安装mysql 安装环境安装包[[email protected] ~]# ls /root/tools/app.tar.gz mysql-5.7.21 mysql-5.7.21.tar.gz nginx-1.15.0.tar.gz nginx_conf.tar.gz操作系统[[email protected] ~]# cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) 内存[[email protected] ~]# f

vue2-preview引用时报错解决办法

1.报错信息 在完全按照官方文档安装引入vue2-preview时出现报错,报错信息如下: 从图中标记处可以知道出错是因为在\node_modules\[email protected]@vue2-preview\src\plugins\preview中找不到./photoswipe/dist/default-skin/default-skin.css这个文件所致的. 2.解决办法 在作者没有解决之前暂时修改插件,不知道有没有后续问题 进入到\node_modules\[email protec

docker删除镜像时报错解决办法

报错信息 [[email protected] ~]# docker rmi 4950a54ede5a Error response from daemon: conflict: unable to delete 4950a54ede5a (must be forced) - image is being used by stopped container 834789a17497 报错原因 image is being used by stopped container 834789a1749

scrapy框架编写向redis数据库中存储数据的相关代码时报错解决办法

错误信息:redis.exceptions.DataError: Invalid input of type: 'dict'. Convert to a byte, string or number first. 解决办法:python中redis包更新导致的问题,变更了srem方法的输入.使用旧版本pip install redis==2.10.6,即可解决 原文地址:https://www.cnblogs.com/lys666/p/10469981.html

Linux安装mysql-python库时报错解决办法

用pip安装mysql-python库的时候遇到如下报错 [email protected]:~# pip install mysql-python Collecting mysql-python Using cached MySQL-python-1.2.5.zip Complete output from command python setup.py egg_info: sh: 1: mysql_config: not found Traceback (most recent call l

eclipse创建maven项目时报错解决办法

1.Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:1.1 from any of the configured repositories. 办法:下载maven-archetype-quickstart-1.1.jar放入安装maven的lib文件夹下,在此处启动dos窗口输入命令:mvn install:install-file -DgroupId=org.apache.ma

在eclipse中使用git的pull功能时报错解决办法

打开项目的 .git/config文件,参照以下进行编辑 [core] symlinks = false repositoryformatversion = 0 filemode = false logallrefupdates = true [branch "master"] remote = origin merge = refs/heads/master [remote "origin"] url = https://github.com/用户名/项目名.gi