PHP错误WARNING: SESSION_START() [FUNCTION.SESSION-START]解决方法
发布:smiling 来源: PHP粉丝网 添加日期:2020-11-25 14:53:17 浏览: 评论:0
这篇文章主要介绍了PHP错误WARNING: SESSION_START() [FUNCTION.SESSION-START]解决方法,需要的朋友可以参考下。
做开发的时候,操作session有时候会遇到这个问题:Warning: session_start() [function.session-start]……
系统环境:WIN2003+IIS6+PHP5.2.12
PHP出现类似如下错误:
Warning: session_start()[function.session-start]: ...... failed: No such file or directory......等情况,可以偿试修改一下php.ini文件中的session.auto_start = 0 改为 session.auto_start = 1
如果重启IIS后问题依然存在,那就是session变量需要系统的临时文件空间,并需要读写的权限。
在php.ini里找到session.save_path = ,设置一个有效的文件夹路径,例如:session.save_path = "c:\php5\session_temp" 并添加该文件夹的权限,让everyone有修改写入的权限即可。
PHP环境:
- OS:CentOS release 5.2 (Final)
- Apache:
- Server version: Apache/2.2.3
- Server built: Jan 15 2008 20:33:30
- php:
- PHP 5.1.6 (cli) (built: May 24 2008 14:07:53)
- Copyright (c) 1997-2006 The PHP Group
- Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
报错信息如下:
- Warning:session_start()[function.session-start]:open(/var/lib/php/session/sess_itqfqua1554rmkgcb8u89ujem5,O_RDWR)failed:Permission denied(13)in www_path on line 9
- Warning:Unknown:open(/var/lib/php/session/sess_itqfqua1554rmkgcb8u89ujem5,O_RDWR)failed:Permission denied(13)in Unknown on line 0
- Warning:Unknown:Failed to write session data (files);Please verify that the current setting of session.sav_path is correct (/var/lib/php/session)in Unknown on line 0
解决办法:
方法1、注释掉/etc/php.ini中
session.save_path = “/var/lib/php/session”
方法2、查看apache用户和组,然后将该用户加到session文件夹所处的组中。
方法3,在session_start() 前不要有任何输出!
然后重启Apache;
OK,问题解决!
Tags: WARNING SESSION_START
相关文章
- ·Warning: mysql_fetch_array():(2013-11-28)
- ·Warning: Missing argument 3 for photo_bigclass()(2013-11-28)
- ·Warning: mssql_connect() [function.mssql-connect]:(2013-11-28)
- ·Warning: mysql_fetch_assoc() expects parameter 1 to be resource(2013-12-02)
- ·Warning: Cannot modify header information - headers already sent by (2013-12-04)
- ·php 提示Warning: mysql_fetch_array() expects(2014-01-09)
- ·Warning: mysql_num_rows():(2014-01-14)
- ·Warning:chmod() has been disabled for security reasons in(2014-08-23)
- ·php提示 Warning: touch() [function.touch]: Utime failed: Permission denied in(2014-09-20)
- ·php提示Warning: file_get_contents(): couldn’t resolve(2014-09-20)
- ·PHP Warning:phpinfo() has been disabled函数禁用(2014-09-21)
- ·php 提示Warning: mysql_fetch_array() expects(2014-09-21)
- ·php下foreach()错误提示Warning: Invalid argument supplied for foreach()(2014-09-22)
- ·phpmyamdin安装出现Warning: require(./libraries/Error_Handler.class.php) 错(2015-04-04)
- ·PHP Warning: implode() [function.implode]: Invalid(2015-04-08)
- ·PHP错误Warning: Cannot modify header information - headers already sent by解决方法(2021-04-14)
推荐文章
热门文章
最新评论文章
- 写给考虑创业的年轻程序员(10)
- PHP新手上路(一)(7)
- 惹恼程序员的十件事(5)
- PHP邮件发送例子,已测试成功(5)
- 致初学者:PHP比ASP优秀的七个理由(4)
- PHP会被淘汰吗?(4)
- PHP新手上路(四)(4)
- 如何去学习PHP?(2)
- 简单入门级php分页代码(2)
- php中邮箱email 电话等格式的验证(2)