1
Janks
Unable to connect to database in file class/database/databasefactory.php line 34
  • 2005/3/21 16:10

  • Janks

  • Just popping in

  • Posts: 2

  • Since: 2005/1/27


I hope I didn't do something very badly....

I wanted to install XOOPS on a sudomain (already got it installed and working on another domain).

When I installed the new Xoops, my old site gave this error:

Quote:
This page cannot be displayed due to an internal error.

If you are the administrator of this site, please visit the XOOPS Troubleshooting Page for assistance.

Error [Xoops]: Unable to connect to database in file class/database/databasefactory.php line 34


This is the Script its about:

Quote:
<?php
class XoopsDatabaseFactory
{

function XoopsDatabaseFactory()
{
}

/**
* Get a reference to the only instance of database class and connects to DB
*
* if the class has not been instantiated yet, this will also take
* care of that
*
* @static
* @staticvar object The only instance of database class
* @return object Reference to the only instance of database class
*/
function &getDatabaseConnection()
{
static $instance;
if (!isset($instance)) {
$file = XOOPS_ROOT_PATH.'/class/database/'.XOOPS_DB_TYPE.'database.php';
require_once $file;
if (!defined('XOOPS_DB_PROXY')) {
$class = 'Xoops'.ucfirst(XOOPS_DB_TYPE).'DatabaseSafe';
} else {
$class = 'Xoops'.ucfirst(XOOPS_DB_TYPE).'DatabaseProxy';
}
$instance =& new $class();
$instance->setLogger(XoopsLogger::instance());
$instance->setPrefix(XOOPS_DB_PREFIX);
if (!$instance->connect()) {
trigger_error("Unable to connect to database", E_USER_ERROR);
}
}
return $instance;
}

/**
* Gets a reference to the only instance of database class. Currently
* only being used within the installer.
*
* @static
* @staticvar object The only instance of database class
* @return object Reference to the only instance of database class
*/
function &getDatabase()
{
static $database;
if (!isset($database)) {
$file = XOOPS_ROOT_PATH.'/class/database/'.XOOPS_DB_TYPE.'database.php';
require_once $file;
if (!defined('XOOPS_DB_PROXY')) {
$class = 'Xoops'.ucfirst(XOOPS_DB_TYPE).'DatabaseSafe';
} else {
$class = 'Xoops'.ucfirst(XOOPS_DB_TYPE).'DatabaseProxy';
}
$database =& new $class();
}
return $database;
}


}
?>


I thought there could be a conflict with these two systems (though they were both installed on different domains on the same server) So I de-installed the newest XOOPS version, but still got this bug in the oldest one.

Now I am not a real smart one whith bugs like this. Ok, maybe a really dumbass...

Could anyone please help me?



2
Janks
Re: Please help DMS .097 import file error
  • 2005/1/27 18:48

  • Janks

  • Just popping in

  • Posts: 2

  • Since: 2005/1/27


I also got an error:

Quote:
Error: Unable to move file.
SP:/tmp/phpBFlMNN
DP:/www/xoops/modules/dms/repository//1/1/1/100002.dat


I think I had configured the repository well, I've got Apache installed on a Linuxserver and I did made the folder writable.

Never had problems with configuring other modules.

Could someone help me with this one?




TopTop



Login

Who's Online

224 user(s) are online (145 user(s) are browsing Support Forums)


Members: 0


Guests: 224


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits