OpenX: switching to another server

I moved the installation to another server. I updated the configuration file in the var / directory and the banners are served, but the admin interface is not working.

I get an error:

A fatal error has occurred. OpenX cannot connect to the database. Because of this, it is not possible to use the admin interface

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

I don’t know which version it is, but it looks at least 2 years old.

Is there any special cache that I don't know about?

Any help on this would be greatly appreciated.

+4
source share
2 answers

Mental note. If you have db on another server, then openx does not matter if you set the host IP address of the db server and port .. if you did not set protocol=protocol !!!

this is by far the stupidest thing I've ever seen, there is no need to configure the protocol since php always uses a socket if you set up "localhost".

+2
source

It is not easy to say exactly what is wrong here, but a good assumption can be made:

As you can see from the error message, there is an object in your code that does not implement the quoteIdentifier() method.

There are two main reasons for this: either we call an older or newer version of the same class instance that does not implement this method. Maybe because he is out of date or who knows. Or the object just doesn't match the expected type.

Lo and now, if we are looking for a class associated with MDB2 that implements this method, this is the class MDB2 . Not MDB2_Error ! So, now we know the cause of the error, it's time to talk about the root cause.

Connecting to a database using MDB2 works something like this:

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

Here it is. We can see that $ mdb2 can really be of type MDB2_Error, in case the connection goes wrong for some reason. Here's why: your code cannot connect to the database for any reason. So, the next obvious step should be checked to see if your db user has the correct permissions and uses the correct password. I am 100% sure that your admin backend is not using the correct credentials.

+1
source

Source: https://habr.com/ru/post/1498318/


All Articles