用户登录  |  用户注册
首 页源码下载网络学院最新源码源码排行屏蔽广告
当前位置:新兴网络 > 网络学院 > PHP编程 > PHP 相关

PHP “Warning: session_start()...” 的解决方法

减小字体 增大字体 作者:佚名  来源:本站整理  发布时间:2011-01-22 16:36:10

PHP “Warning: session_start()...” 的解决方法:
        出现类似以下错误:

Warning: session_start(): open(C:/Program Files/php/sessiontemp\sess_0cde28de3ce1a2e2cc8e8723b5a40279, O_RDWR) failed: Permission denied (13) in D:\home\400m\zmxxx\web\syssite\install\datainstall.php on line 7

Warning: Unknown(): open(C:/Program Files/php/sessiontemp\sess_0cde28de3ce1a2e2cc8e8723b5a40279, 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.save_path is correct (C:/Program Files/php/sessiontemp) in Unknown on line 0

解决办法:
修改php.ini中的session.auto_start = 0session.auto_start = 1
重启IIS调试!

如果还提示以下类似的警告:

Warning: session_start() [function.session-start]: open(/tmp\sess_84cb589ea249708b09c3d5e6836fdd0d, O_RDWR) failed: No such file or directory (2) in E:\web\htdocs\111.php on line 9 

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

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

Warning: Unknown(): open(/tmp\sess_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:\WINDOWS\temp" )
session.save_path =前面的 “;”分号去掉

另外编辑该文件夹的权限 添加EVERYONE 有写入修改权限即可!
 

Tags:session_start php 错误

作者:佚名
  • 好的评价 如果您觉得此文章好,就请您
      67%(4)
  • 差的评价 如果您觉得此文章差,就请您
      33%(2)

网络学院评论评论内容只代表网友观点,与本站立场无关!

   评论摘要(共 0 条,得分 0 分,平均 0 分) 查看完整评论