I’ve migrated a site to our hosting, standard ubuntu Plesk 11 server…
The site will not run, it stops at this line, with no error logged, or returned to the screen.
$db=&DB::connect("mysql://$config[db_username]:$config[db_password]@$config[db_host]/$config[db_name]" );
The config array is populated with the correct info for the database. The next few lines of code are
if (PEAR::isError($db)) {
print nl2br(var_export($db));
die("Failed connecting to database");
}
Which the program never gets to? So I’m really stuck. It has the correct info, the database is there, but it does not appear to be able to get any further than the DB::connect line, but isn’t showing any error?
2
Answers
Well the above didn't return anything either, but I did find that DB has been superceeded by MDB2, so I updated with
and
Which did get me an error, saying PHP Fatal error: Call to undefined function: MDB2_Driver_mysql::getAll(). in /usr/share/php/MDB2.php on line 1936
So I added this
From this question Fatal error: Call to undefined function: MDB2_Driver_MYSQL::getAll()
and it seems to have connected. Still not quite there but now I have something on the screen ! Thanks all.
Try to add these lines inside your “if block” to find out the error reason:
Print additional info:
Look at this link: http://pear.php.net/manual/en/package.database.db.db-error.php