doubei2340 2014-10-01 21:38
浏览 10
已采纳

致命错误:调用非对象上的成员函数(impresspages)

I am getting this error code on my impresspages.

 Fatal error: Call to a member function log() on a non-object in /home/public_html/site/index.php on line 52

I havnt changed anything on the website for 6 months. Suddenly a few days ago it started and has contued since.

This is my index.php:

<?php
/**
 *
 * ImpressPages CMS main frontend file
 *
 * This file initiates required variables and outputs the content.
 *
 * @package ImpressPages
 *
 *
 */




/** Make sure files are accessed through index. */

if (!defined('CMS')) {
    define('CMS', true); // make sure other files are accessed through this file.
}
if (!defined('FRONTEND')) {
    define('FRONTEND', true); // make sure other files are accessed through this file.
}


if((PHP_MAJOR_VERSION < 5) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 3)) {
    echo 'Your PHP version is: '.PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION.'. To run ImpressPages CMS you need PHP 5.3.*';
    exit;
}


if(is_file(__DIR__.'/ip_config.php')) {
    require (__DIR__.'/ip_config.php');
} else {
    require (__DIR__.'/../ip_config.php');
}


if (DEVELOPMENT_ENVIRONMENT){
    error_reporting(E_ALL|E_STRICT);
    ini_set('display_errors', '1');
} else {
    ini_set('display_errors', '0');
}



try {
    require_once(BASE_DIR.FRONTEND_DIR.'init.php');
    require_once(BASE_DIR.FRONTEND_DIR.'bootstrap.php');
} catch (\Exception $e) {
    $log->log('System', 'Exception caught', $e->getMessage().' in '.$e->getFile().':'.$e->getLine());
    throw $e;
}

These are line 52/53:

$log->log('System', 'Exception caught', $e->getMessage().' in '.$e->getFile().':'.$e->getLine());
throw $e;

Can somebody please explain why this is occuring and what i can do?

  • 写回答

1条回答 默认 最新

  • douba9776 2014-10-03 14:15
    关注

    I deleted some lines in the error_handler.php (about line 64 if someone is interested) and the message was suddenly gone. Everything is fine ... for now :D

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于大棚监测的pcb板设计
  • ¥20 sim800c模块 at指令及平台
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计