我笨3.0网站,该网站已经启动并运行,直到今天早上,已经停止了工作,突然,呈现在所有页面上出现以下错误信息:如何调试笨致命错误
Fatal error: Call to a member function row() on a non-object in /home/[mysite]/public_html/system/libraries/Session/drivers/Session_database_driver.php on line 160
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home/[mysite]/public_html/system/libraries/Session/drivers/Session_database_driver.php:160)
Filename: core/Common.php
Line Number: 569
A PHP Error was encounteredSeverity: Error
Message: Call to a member function row() on a non-object
Filename: drivers/Session_database_driver.php
Line Number: 160
而且,在error_log
中显示以下错误消息:两天前两个&的内存耗尽消息(不知道它们是否相关,因为网站在这些之后运行良好,并且它们只出现两次),然后很多的相同的PHP致命错误(我只复制了三个,但有很多很多相同的错误):
[10-Oct-2015 06:04:04 UTC] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 12 bytes) in /home/[mysite]/public_html/system/database/DB_driver.php on line 919
[11-Oct-2015 02:52:43 UTC] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 32 bytes) in /home/[mysite]/public_html/system/database/drivers/mysqli/mysqli_result.php on line 168
[13-Oct-2015 08:25:51 UTC] PHP Fatal error: Call to a member function row() on a non-object in /home/[mysite]/public_html/system/libraries/Session/drivers/Session_database_driver.php on line 160
[13-Oct-2015 08:26:08 UTC] PHP Fatal error: Call to a member function row() on a non-object in /home/[mysite]/public_html/system/libraries/Session/drivers/Session_database_driver.php on line 160
[13-Oct-2015 08:26:17 UTC] PHP Fatal error: Call to a member function row() on a non-object in /home/[mysite]/public_html/system/libraries/Session/drivers/Session_database_driver.php on line 160
在Session_database_driver.php
160行是这样的:
if (($result = $this->_db->get()->row()) === NULL)
和线569在core/Common.php
是这样的:
header($server_protocol.' '.$code.' '.$text, TRUE, $code);
这是包含臭名昭著线160的功能:
public function read($session_id)
{
if ($this->_get_lock($session_id) !== FALSE)
{
// Needed by write() to detect session_regenerate_id() calls
$this->_session_id = $session_id;
$this->_db
->select('data')
->from($this->_config['save_path'])
->where('id', $session_id);
if ($this->_config['match_ip'])
{
$this->_db->where('ip_address', $_SERVER['REMOTE_ADDR']);
}
if (($result = $this->_db->get()->row()) === NULL)
{
$this->_fingerprint = md5('');
return '';
}
// PostgreSQL's variant of a BLOB datatype is Bytea, which is a PITA to work with, so we use base64-encoded data in a TEXT field instead.
$result = ($this->_platform === 'postgre')
? base64_decode(rtrim($result->data))
: $result->data;
$this->_fingerprint = md5($result);
$this->_row_exists = TRUE;
return $result;
}
$this->_fingerprint = md5('');
return '';
}
但他们都是原始的CI文件。我没有改变任何东西。
我不知道什么地方出了问题,是什么导致了这一点,我不知道如何开始调试它,因为错误信息都指向CI文件,而不是我写的代码。
任何指针如何开始调试,将不胜感激!
添加与此相关的 –
完整的代码这正是问题 - 我不知道有什么相关的代码做,因为错误消息不指向我的代码中的任何特定行,只在线路框架的原始文件。 – einav
添加此代码的地方'if(($ result = $ this - > _ db-> get() - > row())=== NULL)' –