您的位置: 首頁>>新聞動態>>網校動態

PHP網站報Warning: session_start(): open錯誤的解決方法

作者: 來源: 時間:2013-04-02

今天我們在調試服務器的時候出現了一個錯誤,下面是錯誤的內容

Warning: session_start(): open(C:/Program Files/php/sessiontempsess_0cde28de3ce1a2e2cc8e8723b5a40279, O_RDWR) failed: Permission denied (13) in D:home400mzmxxxwebsyssiteinstalldatainstall.php on line 7

Warning: Unknown(): open(C:/Program Files/php/sessiontempsess_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 = 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

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:WINDOWS emp" )
session.save_path =前面的 “;”分號去掉

另外編輯該文件夾的權限 添加EVERYONE 有寫入修改權限即可!

 

返回列表 相關標簽:
午夜dj视频免费观看,gogo大胆全球裸xxxx,日本抽搐喷水A∨片,他掀我的裙子添的我下面好爽