2010-03-17 55 views
2

獲取試圖啓動一個會話時,出現以下錯誤:PHP錯誤:警告:在session_start()[function.session啓動]:節點不再存在

Warning: session_start() [function.session-start]: Node no longer exists in file.php on line 3

腳本使用SimpleXML來解析XML來自遠程主機的文件。它運行在使用PHP 5.2.6的Linux Ubuntu服務器上。

有沒有人遇到過此消息之前,或有一個洞察到什麼意思?

+0

你究竟做了什麼? – Gumbo 2010-03-17 16:30:00

+0

@Gumbo我個人還是劇本? – Camsoft 2010-03-17 16:31:38

+4

那麼,因爲我們正在談論你的腳本...... – Gumbo 2010-03-17 16:43:33

回答

4

this page

[2009-09-25 11:41 UTC] [email protected] 

Thank you for taking the time to write to us, but this is not 
a bug. Please double-check the documentation available at 
http://www.php.net/manual/ and the instructions on how to report 
a bug at http://bugs.php.net/how-to-report.php 

Cannot serialize object wrapping 3rd party library structs. Must 
serialize the xml (to a string) and store that to session and reload the 
xml when restoring from session 
+1

示例:http://www.php.net/manual/en/book.simplexml.php#87083 – Rabbott 2010-03-17 16:35:08

+0

謝謝!這讓我瘋狂。偉大的事情要知道。 – split19 2012-08-02 18:34:09

+0

這個例子很好地解釋了這個問題,謝謝! – 2013-08-05 15:56:44

2

您無法將SimpleXML結果存儲在會話中。將其轉換爲數組或使用喚醒和睡眠魔法方法進行擴展。

2

我有同樣的問題,並得到了現場修復http://www.ossramblings.com/simple_xml_breaks_sessions

其實在嘗試存儲XML數據的會話將無法正常工作,所以只是將XML數據(我的意思是對象)的字符串作爲如下:

$temp_max_markers = (string)$Response->owner->max_markers; 

$_SESSION['max_markers'] = $temp_max_markers; 
0

還你無法在會話名稱使用xml作爲.. $_SESSION[xml];

0

您可以更改配置文件中的應用程序文件夾中笨的加密密鑰,它的工作原理對於m e ..

相關問題