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
Non-Default DB Port!
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Non-Default DB Port!
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
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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
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?
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
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'];
}Thanks Garvin.
- Nick
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?
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
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'];
}Thanks Garvin.
- Nick
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
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
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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
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
Take good care.
- Nick
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi Nick!
Thanks for the update. I guess in that case things should resolve themselves.
Best regards,
Garvin
Thanks for the update. I guess in that case things should resolve themselves.
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/