Re: [OT] Accessing PostgreSQL through Apache and PHP4 - Mailing list pgsql-general

From wsheldah@lexmark.com
Subject Re: [OT] Accessing PostgreSQL through Apache and PHP4
Date
Msg-id 200110181859.OAA09930@interlock2.lexmark.com
Whole thread Raw
List pgsql-general

This looks like a php/Apache problem.  During my brief fling with php, I got
best results when I built apache and php together using apachetoolbox from
apachetoolbox.com.  Running Slackware, I had postgresql in the standard
/usr/local/pgdata directory, and the apachetoolbox scripts found it there and
built support for it into php.  Relatively painless.

Ultimately, I ditched php in favor of using mod_perl and Mason, mainly because
php database calls were SO database specific and I couldn't find a decent
abstraction layer, and also because I couldn't find a decent templating
solution.  I found some attempts at both, but DBI and Mason are years ahead in
terms of features.  ObDisclaimer: I've been using perl for several years now, so
that may have unfairly raised my expectations or otherwise biased my evaluation.
:-)

Wes
P.S.  Even more OT: Anyone know how to access email on a domino server using a
generic linux mail client?  No, I don't believe our domino server is set up to
support IMAP or POP.



"Holt, Jack C." <JACK.C.HOLT%saic.com@interlock.lexmark.com> on 10/18/2001
10:55:42 AM

To:   pgsql-general%postgresql.org@interlock.lexmark.com
cc:    (bcc: Wesley Sheldahl/Lex/Lexmark)
Subject:  [GENERAL] Accessing PostgreSQL through Apache and PHP4 on Linux

I am running PostgreSQL 7.1.3, RedHat 7.1 (kernel 2.4.2-2), and PHP/4.0.4pl1.
When I try to run a PHP page found below I get an error that says:



Fatal error: Call to undefined function: pg_connect() in
/var/www/html/psolver.php on line 10



Additionally, even though pgsql.so IS in /usr/lib/php4 (and php.ini tells PHP to
look there for extensions), I get the following error on the call to dl().



Warning: Unable to load dynamic library '/usr/lib/php4/pgsql.so' - libpq.so:
cannot load shared object file: No such file or directory in
/var/www/html/psolver.php on line 7



Code snippet:

-----------------------------------------------------------------------------------------------

<?

  dl("pgsql.so");



  //connect to database

  $conn = pg_connect("","","","psolver");

  if(!$conn) {

    print("Couldn't connect to psolver");

    exit;

  }

?>





pgsql-general by date:

Previous
From: Andrew Gould
Date:
Subject: Re: Accessing PostgreSQL through Apache and PHP4 on Linux
Next
From: "Steve Brett"
Date:
Subject: Re: URGENT: Index problems - update - please help ....