Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenX: Moved to different Server

Tags:

php

openx

I moved the installation to a different server. I updated the configfile in the var/ directory and the banners are served, but the admin interface is not working.

i get the error:

A fatal error occurred OpenX can't connect to the database. Because of this it isn't possible to use the administrator interface

i cleaned the cache directory in var but then i get PHP Fatal error: Call to undefined method MDB2_Error::quoteIdentifier() in /[path]/opx/lib/OA/Upgrade/VersionController.php on line 50

I dont know which version this is, but it looks like its at least 2 years old.

Is there any special cache in place im not aware of?

Any help on this would be much appreciated.

like image 798
Rufinus Avatar asked Oct 03 '22 04:10

Rufinus


2 Answers

Mental note,.. if you have the db on a different server then openx it does not matter if you set the host to the ip of the db server and the port.. as long if you not set protocol=protocol !!!

this is by far the most stupidest thing i have ever seen, there is no need for a protocol config, as php always uses the socket if you set "localhost".

like image 77
Rufinus Avatar answered Oct 07 '22 19:10

Rufinus


It's not easy to tell exactly what's wrong here, but one can make a good guess:

As we can see from the error message, there is an object in your code that doesn't implement the method quoteIdentifier().

There are mainly two possible reasons for this: Either we're calling an older or newer version of the same Class instance which doesn't implement the method. Maybe because it's deprecated or who knows. Or the object simply isn't of the expected type.

Lo and behold, if we look for an MDB2 related class that DOES implement this method, it's the class MDB2. Not MDB2_Error! So now we know the reason for the error, it's time to speculate about the root cause.

Connecting to a database with MDB2 works roughly like this:

$mdb2 =& MDB2::connect('pgsql://usr:pw@localhost/dbnam');
if (PEAR::isError($mdb2)) {
    die($mdb2->getMessage());
}

There it is. We can see that $mdb2 can actually be of type MDB2_Error, in case connecting goes wrong for some reason. So that is the cause: Your code cannot connect to the DB for some reason. So the next obvious step should be checking if your db user has the correct rights and is using the correct password. I am 100% sure your admin backend doesn't use the right credentials.

like image 40
ciruvan Avatar answered Oct 07 '22 19:10

ciruvan