【发布时间】:2013-07-30 03:48:12
【问题描述】:
我正在尝试连接到我的数据库,但我收到错误 JFactory class not found /var/www/joomla2.5/database.php 我的代码是
$db= JFactory::getDBO();
我也尝试在外部建立数据库连接,但我收到错误 JDatabase class not found
<?php
$option = array(); //prevent problems
$option['driver'] = 'mysql';
$option['host'] = 'localhost';
$option['user'] = 'xxxx';
$option['password'] = 'xxxx';
$option['database'] = 'xxxx';
$option['prefix'] = 'cdri_';
$db = & JDatabase::getInstance( $option );
?>
我检查了我的 factory.php 文件,它定义了一个抽象的 JFactory 类。
我正在使用 joomla2.5 和 Ubuntu12.04 操作系统
需要帮助...
【问题讨论】:
-
请说明您在哪里编写此代码。
-
在我的 joomla 文件夹中的一个 php 文件中。
标签: joomla joomla2.5 joomla1.5 joomla-extensions joomla1.7