【发布时间】:2013-04-24 23:24:24
【问题描述】:
将本地服务器迁移到远程后,出现上述错误。我已经用最新的 2.5.10 升级了 joomla,但仍然遇到同样的错误。 请问我该如何解决这个问题? 下面是第 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;
}
}
【问题讨论】:
-
无法获得数据库连接。您的数据库正在使用 Joomla 运行和设置?
-
是的,我的 Db 运行平稳,后端工作正常。
-
不知道。也许损坏的文件......似乎不太可能出现错误。但是再次升级不会有什么坏处。
-
下载一个新的Joomla副本,解压“includes”和“libraries”文件夹,然后通过FTP上传这两个文件夹(最好是zip文件)并解压。并在将本地移动到服务器之前检查您的所有设置是否正确