2013-04-24 37 views
0

將我的本地服務器遷移到遠程後,出現上述錯誤。我已經升級了最新的2.5.10的joomla,我仍然得到相同的錯誤。 請問我該如何解決這個問題? 下面是一行代碼71找不到類'JFactory'/httpdocs/libraries/joomla/session/storage/database.php on line 71

public function write($id, $data) 
{ 
    // Get the database connection object and verify its connected. 
    $db = JFactory::getDbo();//Line 71 
    if (!$db->connected()) 
    { 
     return false; 
    } 

    try 
    { 
     $query = $db->getQuery(true); 
     $query->update($db->quoteName('#__session')) 
     ->set($db->quoteName('data') . ' = ' . $db->quote($data)) 
     ->set($db->quoteName('time') . ' = ' . $db->quote((int) time())) 
     ->where($db->quoteName('session_id') . ' = ' . $db->quote($id)); 

     // Try to update the session data in the database table. 
     $db->setQuery($query); 
     if (!$db->execute()) 
     { 
      return false; 
     } 
     /* Since $db->execute did not throw an exception, so the query was successful. 
     Either the data changed, or the data was identical. 
     In either case we are done. 
     */ 
     return true; 
    } 
    catch (Exception $e) 
    { 
     return false; 
    } 
} 
+0

它無法獲得數據庫連接。你的數據庫正在運行並與Joomla安裝? – Tom 2013-04-25 01:22:54

+0

是的,我的Db運行平穩,後端正在正常工作。 – jking 2013-04-25 03:10:38

+0

不知道。也許損壞的文件...似乎不太可能與錯誤。但不會再傷害升級。 – Tom 2013-04-25 03:35:08

回答

1

唯一的解決這個問題是安裝一個新的Joomla和重新開始。我試圖升級,甚至下載新的2.5.10升級文件,因爲那時我的舊joomla 2.5.9還沒有發生。

我所做的只是創建一個新的數據庫並重新安裝joomla。

相關問題