Re: PHP/PearDB works on commandline but not via http....
| From: | pw | Date: | Wed, 18 Aug 2004 21:23:49 +0000 |
| Subject: | Re: PHP/PearDB works on commandline but not via http.... | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-194191@lists.php.net to get a copy of this message | ||
Matthew Sims wrote:
And check to see that PostgreSQL is accepting network connections rather than localhost. Is it listening to a port?Connecting remotely to postgres via the command line: psql -h nnn.nnn.nnn.nnn database_name -p 5432 -U user -W works fine. Like I wrote before, if I run the same script from the command line with the same php build... ie: cmd_line/> php db_test.php the script works fine and retrieves data fromt he database. If I try to serve the same php page via apache it can't connect, thus no $db object is returned from $db=DB::connect("pgsql://yada:blah@nnn.nnn.nnn.nnn/databasename"); I've tried running the php as various users including apache from the command line and it continues to work fine there. So, it's not a user permissions thing. Peter