我得到在我的Zend應用這個奇怪的錯誤使用這段代碼:使用在Zend中的應用curl_init導致會話錯誤
$curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'www.xyz.com/ab.php'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($curl); curl_close($curl); if (!isset($location->country)) { $location = new Zend_Session_Namespace('location'); $xml = new SimpleXMLElement($data); $location->city=$xml->City; }
這是錯誤的,我得到:
Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'session has already been started by session.auto-start or session_start()
當我刪除代碼一切正常。 任何想法?
編輯:關於進一步的調試,我發現這個錯誤並不是因爲捲髮代碼 - 當我分配$ location-> city = $ xml-> City時發生錯誤; 但是,當我將該行更改爲$ location-> city =''。$ xml-> City。''; 它開始工作..........這讓我瘋狂!
謝謝我將檢查出 – Gublooo 2010-05-07 06:30:34