Page 1 of 1
Non-Default DB Port!
Posted: Thu Jan 11, 2007 8:22 pm
by NicZak
During my Serendipity installation I keep getting the error msg: "Could not connect to database; check your settings." I am sure this is because I am running Postgres on a non-standard port. I tried putting "localhost:5434" in the 'Database Host' section of the config, but no luck. How can I configure serendipity to connect on the non-standard port?
Thanks.
- Nick
Re: Non-Default DB Port!
Posted: Fri Jan 12, 2007 8:50 am
by garvinhicking
Hi!
Could you try to put "localhost,port=5434" instead?
Do you get other PHP applications to work with your pgsql application? If they also don't work it might be a matter of the postgresql daemon which might not be listening on the localhost domain for connections?
Best regards,
Garvin
Posted: Fri Jan 12, 2007 5:40 pm
by NicZak
I really don't know PHP, but I thought I would have no problem hacking the code below to connect on 5434, what am I doing wrong? What needs to be added and where?
Code: Select all
function serendipity_db_connect() {
global $serendipity;
if (isset($serendipity['dbPersistent']) && $serendipity['dbPersistent']) {
$function = 'pg_pconnect';
} else {
$function = 'pg_connect';
}
$serendipity['dbConn'] = $function(
sprintf(
'%sdbname=%s user=%s password=%s',
strlen($serendipity['dbHost']) ? ('host=' . $serendip$
$serendipity['dbName'],
$serendipity['dbUser'],
$serendipity['dbPass']
)
);
return $serendipity['dbConn'];
}
I assume the postgresql daemon is running, db connections are all live, is there a way to check that its running for sure? Oh and btw: On my system the command is not psql its psqld, is that going to require me to make changes to any part of the config?
Thanks Garvin.
- Nick
Posted: Fri Jan 12, 2007 5:40 pm
by NicZak
I really don't know PHP, but I thought I would have no problem hacking the code below to connect on 5434, what am I doing wrong? What needs to be added and where?
Code: Select all
function serendipity_db_connect() {
global $serendipity;
if (isset($serendipity['dbPersistent']) && $serendipity['dbPersistent']) {
$function = 'pg_pconnect';
} else {
$function = 'pg_connect';
}
$serendipity['dbConn'] = $function(
sprintf(
'%sdbname=%s user=%s password=%s',
strlen($serendipity['dbHost']) ? ('host=' . $serendip$
$serendipity['dbName'],
$serendipity['dbUser'],
$serendipity['dbPass']
)
);
return $serendipity['dbConn'];
}
I assume the postgresql daemon is running, db connections are all live, is there a way to check that its running for sure? Oh and btw: On my system the command is not psql its psqld, is that going to require me to make changes to any part of the config?
Thanks Garvin.
- Nick
Posted: Fri Jan 12, 2007 6:01 pm
by NicZak
Sorry for double post! Not sure how I managed to do that!
- Nick
Posted: Sat Jan 13, 2007 10:36 am
by garvinhicking
Hi!
Are other PHP applications working on your system with Postgresql?
Before we start hacking the s9y code, we should make sure your postgresql actually works with PHP...
HTH,
Garvin
Posted: Tue Jan 16, 2007 6:04 pm
by NicZak
Garvin: Good idea, I agree it makes sense to establish that PHP is working in conjunction with Postgres prior to modifying the code. Is there a standard method of testing to determine whether or not we are good to go? Thanks Garvin, you do great work.
- Nick
Posted: Tue Jan 16, 2007 7:08 pm
by NicZak
Garvin: Sorry for replying to myself here, but I just thought I'd save you from wasting your time, I spoke w/ our sysadmin here and he informed me that the Pg PHP modules are installed on the public server but not on the development server. As you may have already guessed I want to host my blog on my dev server, so I will get those modules loaded up and proceed forward! Thanks for all of your hard work and I look forward to our future interactions.
Take good care.
- Nick
Posted: Wed Jan 17, 2007 8:45 am
by garvinhicking
Hi Nick!
Thanks for the update. I guess in that case things should resolve themselves.
Best regards,
Garvin