hello I am installing the version of ojs 3.1 with apache2 php5.6 and postgresql 9.4. After putting the initial data in the installation it gives this error: Errors occurred during installation A database error has occurred: Database connection failed
I need urgent help please
Hi @elpb,
Check your database credentials to ensure they’re valid.
Regards,
Alec Smecher
Public Knowledge Project Team
I’ve done that several times. Look how the postgresql configuration should be but it still does not work.
Hi @elpb,
I would suggest checking in your PostgreSQL log to see if there are details there, e.g. logging an access attempt that was denied due to a problem with the username/password. You might also check to make sure your server is running where PHP expects to find it, e.g. on either UNIX domain sockets or IP domain.
Regards,
Alec Smecher
Public Knowledge Project Team
The problem may be with the version of postgresql that I am using? The one that installs is postgresql 9.4
the issue is that from the server console I can connect either by localhost with the server ip but when I start the installation of the ojs I get the connection error.
Hi @elpb,
I would suggest looking into ADODB (the database abstraction library we use) is attempting to connect to PostgreSQL, in order to remove the complexity of OJS and ADODB and reduce the problem to a PHP pg_pconnect
or pg_connect
call.
The connection is created in lib/pkp/lib/adodb/drivers/adodb-postgres64.inc.php
in the _connect
function. You could use error_log
calls to trap the parameters to the pg_pconnect
or pg_connect
calls, then write a quick test script to try reproducing the problem outside of OJS (see http://php.net/manual/en/function.pg-pconnect.php for details on that function and some examples).
Once you’re able to get it connecting via a quick PHP script, then I’d suggest moving back into the OJS/ADODB environment for further debugging.
Regards,
Alec Smecher
Public Knowledge Project Team