Re: [PHP] PHP/PearDB works on commandline but not via http....
Justin Patrin wrote: Did you try: if(PEAR::isError($db)) { echo $db-getMessage().' '.$db-getUserInfo(); } It's probably because: 1) the postgres the module isn't in the PHP that apache is using 2) the postgres module isn't loaded in the PHP that apache is using 3) the postgres module in the PHP that apache is using is connecting via a socket instead of a port (or vice-versa) I think you may have something with the apache module points. I'll ask if apache has been built or is just the install from the linux distro. I built apache previously, but I didn't install this machine Thanks for the ideas, Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/PearDB works on commandline but not via http....
On Thu, 19 Aug 2004 08:44:39 -0700, pw [EMAIL PROTECTED] wrote: Justin Patrin wrote: Did you try: if(PEAR::isError($db)) { echo $db-getMessage().' '.$db-getUserInfo(); } It's probably because: 1) the postgres the module isn't in the PHP that apache is using 2) the postgres module isn't loaded in the PHP that apache is using 3) the postgres module in the PHP that apache is using is connecting via a socket instead of a port (or vice-versa) I think you may have something with the apache module points. I'll ask if apache has been built or is just the install from the linux distro. I built apache previously, but I didn't install this machine Write a script with just: ?php phpinfo(); ? Run it through apache. Look for the postgres module (may be called pgsql). -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP/PearDB works on commandline but not via http....
Hello, I have an interesting problem with PostgreSQL via PearDB and PHP 4.3.3 . I have a php page that opens a remote connection to a Postgres database, performs a query, lists the results and then closes the connection. If I run the php from the command line the connection and query work fine. Php dumps a nice web page with all the data that I am asking for. If I serve the same php page via apache from the same machine, php fails to open the database connection and thus the page fails to fill out. PearDB is installed and working since if(DB::iserror($db)) detects the error. Anyone have any ideas? Thanks, Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/PearDB works on commandline but not via http....
On Wed, 18 Aug 2004 12:53:25 -0700, pw [EMAIL PROTECTED] wrote: Hello, I have an interesting problem with PostgreSQL via PearDB and PHP 4.3.3 . I have a php page that opens a remote connection to a Postgres database, performs a query, lists the results and then closes the connection. If I run the php from the command line the connection and query work fine. Php dumps a nice web page with all the data that I am asking for. If I serve the same php page via apache from the same machine, php fails to open the database connection and thus the page fails to fill out. PearDB is installed and working since if(DB::iserror($db)) detects the error. Anyone have any ideas? Can't help you unless you give us an error... -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/PearDB works on commandline but not via http....
On Wed, 18 Aug 2004 12:53:25 -0700, pw [EMAIL PROTECTED] wrote: Hello, I have an interesting problem with PostgreSQL via PearDB and PHP 4.3.3 . I have a php page that opens a remote connection to a Postgres database, performs a query, lists the results and then closes the connection. If I run the php from the command line the connection and query work fine. Php dumps a nice web page with all the data that I am asking for. If I serve the same php page via apache from the same machine, php fails to open the database connection and thus the page fails to fill out. PearDB is installed and working since if(DB::iserror($db)) detects the error. Anyone have any ideas? Can't help you unless you give us an error... And check to see that PostgreSQL is accepting network connections rather than localhost. Is it listening to a port? -- --Matthew Sims --http://killermookie.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/PearDB works on commandline but not via http....
Justin Patrin wrote: Can't help you unless you give us an error... There's no error. DB_Error::toString() returns the following. [: message= code=0 mode= level= prefix= info=] Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/PearDB works on commandline but not via http....
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:[EMAIL PROTECTED]/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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP/PearDB works on commandline but not via http....
On Wed, 18 Aug 2004 14:23:49 -0700, pw [EMAIL PROTECTED] wrote: 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:[EMAIL PROTECTED]/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. Did you try: if(PEAR::isError($db)) { echo $db-getMessage().' '.$db-getUserInfo(); } It's probably because: 1) the postgres the module isn't in the PHP that apache is using 2) the postgres module isn't loaded in the PHP that apache is using 3) the postgres module in the PHP that apache is using is connecting via a socket instead of a port (or vice-versa) -- DB_DataObject_FormBuilder - The database at your fingertips http://pear.php.net/package/DB_DataObject_FormBuilder paperCrane --Justin Patrin-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php