PostgreSQL access not working in PHP.

Craig White craigwhite at azapple.com
Wed Mar 23 02:12:35 UTC 2005


On Wed, 2005-03-23 at 11:12 +1100, Neil Dugan wrote:
> I am trying to use PostgreSQL in php under Fedora 3.
> 
> I am using the standard RPM (retrieved by up2date).
> PHP 4.3.10 (cgi) (built: Dec 21 2004 09:18:25)
> 
> The php function 
> function_exists('pg_connect')
> always returns FALSE
> 
> 
> The script below
> ----------------
> #! /usr/bin/php
> <?php
> $dbconn = pg_connect ("dbname=mydb");
> if (!$dbconn) {
> 	echo "Failed to connect!\n";
> 	exit;
> }
> ?>
> ----------------
> Gives the output of
> ----------------
> PHP Fatal error:  Call to undefined function:  pg_connect()
> in /tmp/test.php on line 3
> Content-type: text/html
> X-Powered-By: PHP/4.3.10
> ----------------
> 
> 
> phpinfo() says that the 'configure command'
> includes '--with-pgsql=shared'
----
just for fun...

did you install php-pgsql ? 'rpm -q php-pgsql'

you give no 'connect' details...

sockets ? TCP/IP ?

did you edit /var/lib/pgsql/data/pg_hba.conf for your connection type?

Craig




More information about the fedora-list mailing list