【发布时间】:2015-03-07 00:36:00
【问题描述】:
我遇到了这个致命错误,但不知道为什么会生成它。任何帮助将不胜感激。该网站可以在线运行,但是一旦我将其下载到我的系统上,它就会显示此错误。
错误信息是:
Fatal error: Call to undefined method Exception::get() in C:\wamp\www\motor_racing_server\templates\yoo_shelf\error.php on line 20
更多信息:
我已经更新了 configuration.php 文件变量。以下是更改的文件列表。
public $dbtype = 'mysql';
public $host = 'localhost';
public $user = 'root';
public $password = '';
public $db = 'motor_racing_joomla';
public $log_path = 'C:\\wamp\\www\\NEW_JOOMLA\\logs';
public $tmp_path = 'C:\\wamp\\www\\NEW_JOOMLA\\tmp';
P.S 数据库名称是正确的,我已经检查过了。
error.php代码如下
<?php
/**
* @package yoo_shelf
* @author YOOtheme http://www.yootheme.com
* @copyright Copyright (C) YOOtheme GmbH
* @license http://www.gnu.org/licenses/gpl.html GNU/GPL
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
// include config
include_once(dirname(__FILE__).'/config.php');
// get warp
$warp = Warp::getInstance();
// set messages
$title = $this->title; // line 19
$error = $this->error->get('code'); // line 20
$message = $this->error->get('message'); // line 21
// set 404 messages
if ($error == '404') {
$title = JText::_('TPL_WARP_404_PAGE_TITLE');
$message = JText::sprintf('TPL_WARP_404_PAGE_MESSAGE', JURI::root(false), $warp['config']->get('site_name'));
}
// render error layout
echo $warp['template']->render('error', compact('title', 'error', 'message'));
我尝试删除第 20 行,代码为第 21 行生成相同的错误。在注释掉第 20 行和第 21 行后,我收到错误“错误 500”。
【问题讨论】:
-
你能显示
error.php的内容吗,至少到第20行? -
你的方法 get() 是静态的吗?或者它是否存在?向我们展示你的异常类可能吗?
-
尝试重命名你的类,也许类 Exception 已经存在于其他地方。这就是这家伙出了什么问题:stackoverflow.com/questions/20023112/…
-
我已在问题下方添加了 error.php 页面。希望这将有助于找到解决方案@mopo922
标签: php joomla joomla-extensions yoothemes