For Programmers: Free Programming Magazines  


Home > Archive > PHP Installation > April 2004 > pear db : can't connect to postgresql









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author pear db : can't connect to postgresql
Gabriel De Rezende E Lamounier

2004-04-27, 1:09 am

i have pear set up on my include_path.
postgresql is running and i'm able to connect and query it using pg_connect()
and pg_query().
i can't conect to pgsql using pear db. here's the script:

<html>
<body>
<?php
require_once("DB.php");

$dsn = "pgsql://postgres/teste";
$db = DB::connect($dsn);

if (DB::isError($db))
{
die($db->getMessage());
}

$db->disconect();
?>
</body>
</html>

error message on the browser:

DB Error: connect failed

it's just a test server, the postgres user dosn't have a password set. using
the native pgsql functions i connect like this:

$db = pg_connect("dbname=teste user=postgres");

any idea?
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com