Page 2 of 2

Re: Error -- serendipity error: unable to connect to databas

Posted: Tue Apr 26, 2016 8:24 pm
by mdwylde
Hi Gentlemen,

Actually the site is running php 5.4. It was the Portege sql app that is current. So I will upgrade to 5.6 and see if that fixes the problem.

I'll get back to you.

Re: Error -- serendipity error: unable to connect to databas

Posted: Tue Apr 26, 2016 9:12 pm
by mdwylde
Hi --

I've updated the site to php 5.6. It did something as I am no longer getting the database error but still cannot connect. I'm now getting this 500 error: www.eartharchitecture.org is currently unable to handle this request but the database error seems to be cleared.

I checked the serendipity_config_local.inc.php and it looked fine. It's addressed correctly.

I am going to look at the postgres.inc.php file next.

Thanks,
Marge

Re: Error -- serendipity error: unable to connect to databas

Posted: Tue Apr 26, 2016 9:32 pm
by onli
Could you look again which specific error message is in the log?

Re: Error -- serendipity error: unable to connect to databas

Posted: Wed Apr 27, 2016 8:30 am
by Timbalu
I don' t know why you thought an upgrade to PHP 5.6 would solve the issue. I am pretty sure it will make things even worse, since you are still on Serendipity 1.5.1, which was not designed with PHP 5.6 in mind.

(Edit: Btw, and to make this clear, while being able to still use 5.3.x or 5.4.x PHP server versions, PHP 5.6.x is recommended to use with a current Version of Serendipity. This is a matter of software development and security.)

Re: Error -- serendipity error: unable to connect to databas

Posted: Wed Apr 27, 2016 4:46 pm
by mdwylde
Morning,

I have executed all your suggestions. The php upgrade cleared the database error but the site still will not load. I am not familiar with this software and in looking for the index location just now did not find anything on the site that looked like it. I saw a number of temporary index files only. I'm wondering if the hack theory is correct and the index file is gone. Where is it normally located?

Also -- I'm willing to go back to the server admin and have them reload support files but need direction on what else to ask for.

Thanks,
Marge

Re: Error -- serendipity error: unable to connect to databas

Posted: Wed Apr 27, 2016 5:02 pm
by onli
Have a look at the filebrwoser in https://github.com/s9y/Serendipity. You should see the same in your webroot. There should be a index.php file.

It could still be helpful to look at the exact php error message in the log of your webserver :)

Re: Error -- serendipity error: unable to connect to databas

Posted: Sun May 01, 2016 2:21 am
by mdwylde
Hello --

I am checking back in. The specific php error that is being received by the server is:
[30-Apr-2016 17:43:46 America/Denver] PHP Fatal error: Call to undefined function pg_connect() in /home1/raelsanf/public_html/eartharchitecture/serendipity/include/db/postgres.inc.php on line 68

Suggestions?

Thanks,
Marge

Re: Error -- serendipity error: unable to connect to databas

Posted: Sun May 01, 2016 2:30 am
by mdwylde
This is what I'm seeing at that location. I previously uploaded a new version of this file. Comparing the code there appeared to be no difference. So is it access to the database that might be the issue?

$serendipity['dbConn'] = $function(
sprintf(
'%sdbname=%s user=%s password=%s',
"$host$port",
$serendipity['dbName'],
$serendipity['dbUser'],
$serendipity['dbPass']
)
);

return $serendipity['dbConn'];
}

Re: Error -- serendipity error: unable to connect to databas

Posted: Sun May 01, 2016 9:10 am
by Timbalu
mdwylde wrote:So is it access to the database that might be the issue?
That is what we were talking about.

Again Marge, check you db credentials in the config_local inc file (see above) and double check them with an independent "connect_test.php" file you make yourself and which can be found on the php website link I pasted above. This will make clear your ISP gave you a working postgres access connection and environment.

(Reset back PHP 5.6 to the one before, because you probably will get more errors after having cleared the db issue. You should do the php upgrade after having done the Serendipity upgrade.)

Otherwise the error you had before and even now "Call to undefined function pg_connect()" hints that PHPs module pgsql is not available. We said this before too. Since your hoster said it is available and running, you need to double check (see above) your connection credentials to see if your ISP is really right about it. Double checking will tell you about pgsql being available and also, if Serendipity is the problem or not.
Knowing this, we can decide to either get back to your ISP or having to tweak Serendipity (which would be strange, since that worked before, didn't it?!).

If you are not sure about your credentials in the *local* inc file, I can offer you to have a look. In this case send me a private message and obfuscate the passwort with ***. I don't need to know that.

Last question: Did you already ask your ISP about to check the postgres pg_hba.conf file and maybe having to set it trust your host?

Re: Error -- serendipity error: unable to connect to databas

Posted: Sun May 01, 2016 9:49 pm
by mdwylde
OK -- I'm on it.

Mare

Re: Error -- serendipity error: unable to connect to databas

Posted: Sun May 08, 2016 4:07 am
by mdwylde
Hello -- I'm back.

I've downgraded the php to 5.4

It looked like the user had been disassociated from the database. I reattached and upgraded the config file. I am now getting this error:
serendipity error: unable to connect to database - exiting.

The hosting provider swears that the PHP module pgsql is there and running.

I will send the config setup separately.

Thanks,
Marge

Re: Error -- serendipity error: unable to connect to databas

Posted: Sun May 08, 2016 9:27 am
by Timbalu
mdwylde wrote:It looked like the user had been disassociated from the database. I reattached and upgraded the config file.
This is strange. Does it mean the serendipity_config_local.inc.php file did not have a line like this

Code: Select all

$serendipity['dbUser'] = 'USERNAME';
or the dbUser was set empty before?

mdwylde wrote:The hosting provider swears that the PHP module pgsql is there and running.
Did they also check with your credentials? Let them try and give you back a valid $connection_string!
Someone must have changed a successfull running connection before, by upgrading something on the servers side.

I'll give you a test file to test this youself. Place it in the Serendipity install root, where the local file lives and run it in your browser by http://www.eartharchitecture.org/exampl ... lename.php. You should get some output, or nothing, which would mean everything is fine, I think. (I have never played around with postgres before.)