php专区

 首页 > php专区 > 正则表达式 > PHP出现 Warning: session_start()的解决方法 - php会话

PHP出现 Warning: session_start()的解决方法 - php会话

分享到:
【字体:
导读:
          错误提示:Warning: session_start() [function session-start]: Cannot send session cache limiter - headers already sent...

PHP出现 Warning: session_start()的解决方法

错误提示:Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at E:phpcodeadmin.php:1) in E:phpcodelogolistadminlogo.php on line 2

解决办法,修改php.ini中的session.auto_start = 0 为 session.auto_start = 1

重启IIS调试!如果还提示以下类似的警告

Warning: session_start() [function.session-start]: open(/tmpsess_84cb589ea249708b09c3d5e6836fdd0d, O_RDWR) failed: No such file or directory (2) in E:webhtdocs111.php on line 9   

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at E:webhtdocs111.php:8) in E:webhtdocs111.php on line 9   

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at E:webhtdocs111.php:8) in E:webhtdocs111.php on line 9   

test222.php   

Warning: Unknown(): open(/tmpsess_84cb589ea249708b09c3d5e6836fdd0d, 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 (/tmp) in Unknown on line 0  

就是 session变量需要系统的临时空间,session.save_path = "设置一个有效文件夹的绝对路径" ,(比如 session.save_path = "C:WINDOWStemp" )

session.save_path =前面的 ' ; '号去掉 ,另外编辑该文件夹的权限 添加EVERYONE 有写入修改权限即可 !

分享到:
PHP如何读取COOKIES - php会话
PHP如何读取COOKIES 察看浏览器的 Cookies 让我们来看看保存在浏览器中的内容,如果你用的是 IE5,在 windows 目录下有一个 cookies 的目录,里面有很多文本文件,文件名都是类似于 wudong@15seconds[1].txt 这样的,这就是浏览器用来保存值的 cookies 了,在以前的 IE 版本中,cookies 的内容是可...
php中 if Else 与Switch 语句对比
在php中if Else 与Switch都是条件判断语句了,那么很多的新学php的朋友搞不清楚php中 if Else 与Switch区别在哪里,下面本文就重点介绍一下. 在网上找到一句:switch比较if具有速度优势,一个是采取转移地址列表的方法;还有就是switch一般在松散的情况下也多不采取"比较-转移 "的方法,而是用dec(sub)-jz的指令对,后者不仅是...
  •         php迷,一个php技术的分享社区,专属您自己的技术摘抄本、收藏夹。
  • 在这里……