Re: PEAR DB, PostgreSQL and postmaster w/o -i
| From: | Tomas V.V.Cox | Date: | Tue, 24 Apr 2001 12:14:43 +0000 |
| Subject: | Re: PEAR DB, PostgreSQL and postmaster w/o -i | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-83@lists.php.net to get a copy of this message | ||
Stephan Engelke wrote:
>
> Hi everyone,
>
> recently I came across the problem of having to "port" a PHP
> application from the use of flat file databases to PostgreSQL. I know
> for a fact that postmaster daemon both in both test and production
> environments runs without the "-i" switch, therefore I get the error
> messages documented in the manual. I can avoid this when I leave out
> the host=... part of the connect string for pg_connect.
>
> Since I don't want to use the pgsql specific functions, I am wondering
> how I could do this with PEAR's DB module? What does the
> DB::connect-line have to look like?
It should work without problems, if not, please post here the problem.
The DSN you should use is:
$dsn = 'pgsql://user:pass@unix+localhost/mydb';
> $db = DB::connect("pgsql://user:passwd@localhost/mydb");
>
> gives the know errormessage. Simply leaving out the @localhost does
> not work either.
>
> I am running PHP 4.0.4pl1 and the PEAR that comes with it.
Please use the last PEAR CVS version (you can get instructions on how to
get them here: http://vulcanonet.com/soft/pear_tut/). With your
version,
the method that parses the $dsn, was broken and perhaps 'unix sockets'
was also unsupported.
Tomas V.V.Cox