Windows Server2008, server 2003 Failed to write session data

给学校服务器安装了APACHE, php. 将程序配置好,运行,一开始好好的后来突然弹出信息。

Warning: session_start() [function.session-start]: open(C:/Users/ADMINI~1/AppData/Local/Temp/1\sess_afb01ee44bc5f0999b4ce5a2fd23349c, O_RDWR) failed: No such file or directory (2) in C:\WEBDASH\www\include\session.php on line 46

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\WEBDASH\www\include\session.php:46) in C:\WEBDASH\www\include\session.php on line 46

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\WEBDASH\www\include\session.php:46) in C:\WEBDASH\www\include\session.php on line 46

Warning: Cannot modify header information - headers already sent by (output started at C:\WEBDASH\www\include\session.php:46) in C:\WEBDASH\www\index.php on line 19

Warning: Unknown: open(C:/Users/ADMINI~1/AppData/Local/Temp/1\sess_afb01ee44bc5f0999b4ce5a2fd23349c, 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 (C:/Users/ADMINI~1/AppData/Local/Temp/1) in Unknown on line 0

之前在Window Server 2003上也出现过这种Session无法读取session,当时清空了cookie问题就解决了。这次的服务器是Server 2008, 幸好能通过MSTSC 登录到远程机器,登入机器后发现系统弹出信息"Windows is not genuine", windows出现了密钥不对的提示。原因知道了因为windows出现了盗版提示,无法将session写入到默认的App_data的位置或者之前保存session的位置因为盗版问题被清空了。 通过修改php.ini的session.save_path位置, 修改到一个你指定的文件夹位置,要确保这个文件夹存在, 重启apache,问题解决。