jawapro Posted June 1, 2007 Share Posted June 1, 2007 G'day, I am trying to set up a webserver as a backup for our current server. So far its going fine - except for one snag. We use Postgres a LOT - but most of it was written before I arrived, and so our code dosnt have a specfic host=localhost in the pg_connect string. $connection = pg_connect("dbname=??? port=5432 user=???"); This works fine on the old server - and we have a heap of scripts that use it (it would be awefull to try and fix each instance) On the new server it seems to require a host in the string $connection = pg_connect("host=localhost dbname=??? port=5432 user=???"); Is there a way to set it so it uses localhost by default if not specified (as it appear to do in the old server). At the moment all I get is an error saying it cant connect. The error complains that it cant find "/tmp/.s.PGSQL.5432" which isnt on the new server (but is on the old) - but I dont know how to set that up either. Sorry for being such a pain - but any help would be appreciated. Cheers, Quote Link to comment https://forums.phpfreaks.com/topic/53820-php-connecting-to-postgres-how-can-i-set-a-default-host/ Share on other sites More sharing options...
trq Posted June 5, 2007 Share Posted June 5, 2007 Odd. These settings are available for MySql in the php.ini, but it does not appear to be the case for postgres. I'de take a look at the old servers php.ini and see whats been done in there. Quote Link to comment https://forums.phpfreaks.com/topic/53820-php-connecting-to-postgres-how-can-i-set-a-default-host/#findComment-268848 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.