Re: A DB::connect problem
| From: | Justin Patrin | Date: | Thu, 23 Jun 2005 22:18:12 +0000 |
| Subject: | Re: A DB::connect problem | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-19749@lists.php.net to get a copy of this message | ||
On 6/23/05, Michael Moerz <natoka@inode.at> wrote:
> Justin Patrin wrote:
>
> >On 6/23/05, Michael Moerz <natoka@inode.at> wrote:
> >
> >
> >
> >I haven't used pgsql myself with PEAR::DB, but perhaps this should be:
> >$dsn = "pgsql://user:pwd@localhost/dbname";
> >or
> >$dsn = "pgsql://user:pwd@localhost:5432/dbname";
> >
> >
> >
> >
> I've tried both and neither works.
>
> >>$dsn = "pgsql://user:pwd@unix(/tmp)/dbname";
> >>
> >>fail with the following code:
> >>
> >>$db = DB::connect($dsn);
> >>if (PEAR::isError($db)) {
> >> die($db->getMessage());
> >>
> >>
> >
> >You may also want to add getUserInfo() to the output here.
> >
> >
> >
> >>}
> >>
> >>
> I'm using now following code: (pgsql is listening on the default port)
>
> <?php
> error_reporting(E_ALL);
> require_once 'php/DB.php';
This require is not correct. It should be:
require_once('DB.php');
1) did you use the PEAR installer?
2) did you set up your include path correctly?
see http://pear.php.net/manual/en/installation.php
> $dsn = "pgsql://user:pwd@localhost/spheres";
>
> echo "Connecting";
> $db = DB::connect($dsn);
> echo "Checking Errors";
> if (PEAR::isError($db)) {
> die($db->getMessage().$db->getUserInfo()); //.$db->getDebugInfo());
> }
> echo "Connected";
> ?>
>
> Anyway the output I get now is just:
>
> Connecting
>
> So something in DB::connect() seems to go wrong, but I don't know how to
> debug that ...
>
--
Justin Patrin