pg_connect takes longer than 5 seconds?

wubaz

New Member
I have just setup a OpenBSD little personal development server running PHP with an almost-default(enabled debugging messages) php.ini and installed PostgreSQL with the default configuration.Well, running this very simple code\[code\]$starttimer=time()+microtime();$dbconn = pg_connect("host=localhost port=5432 dbname=earlzblog_001 user=xxx password=xxx") or die("Couldn't Connect".pg_last_error());pg_close($dbconn);$stoptimer = time()+microtime();echo "Generated in ".round($stoptimer-$starttimer,4)." s";\[/code\]the result is "generated in 6.xxs. Why is it taking 6 seconds to simply make a database connection? Using PgAdmin3, the connections don't take any time at all. Am I suppose to be using persistent connections here? Or unix-sockets or something?
 
Back
Top