Undefined pg_prepare() in 5.1.6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hello,

I recently added new code (containing calls to pg_prepare and related
functions) to a system that had not previously used prepared statements,
and started getting "Call to undefined function pg_prepare()" errors.  I
did a rebuild and install of Apache 2.2.3 and PHP 5.1.6, using the
following configure line for PHP:
./configure --with-apxs2=/usr/local/apache/bin/apxs \
--with-pgsql=/usr/local/pgsql --with-mysql=/usr/local/mysql \
--enable-force-cgi-redirect --disable-cgi --with-zlib --with-gettext

The following code:

<?php
$dbconn = pg_connect("host=localhost port=5432 dbname=test user=test password=test");
if(!$dbconn) {
    echo "Unable to connect to test database\n";
    echo pg_last_errror($dbconn);
    exit;
}
// Prepare a query for execution
$result = pg_prepare($dbconn, "my_query", 'SELECT * FROM phone WHERE name = $1');
...
?>

still gives me this in the apache log:

[Wed Nov 01 09:42:48 2006] [error] [client xx.xxx.xxx.x] PHP Fatal error:  Call to undefined function pg_prepare() in /usr/local/apache/htdocs/php/dbtest.php on line 9

Other than this, PHP and non-prepare related pg_* functions work fine.
php_info() reports that it sees version 8.0.3 of libpq.  However, when I
do <?php print_r(get_extension_funcs("pgsql")); ?> I don't see
pg_prepare or any of the other post 5.1.0 pg_* functions.

I've not been able to find any help on this in the FAQ or by searching
the archives.  I have other servers that I've set up more-or-less
identically to this one where everything works fine.  It seems like this
must be something really stupid, but I'm stumped.  Any help/pointers
would be greatly appreciated.

-Steve
-- 
(   Stephen L. Mathias, Ph.D.  (   s m a t h i a s  (
 )  Division of Biocomputing    )  @ p o b l a n o   )
(   UNM School of Medicine     (   . h e a l t h .  (
 )                              )  u n m . e d u     )
(         http://poblano.health.unm.edu/            (

[Index of Archives]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [Postgresql]     [PHP Books]     [PHP Databases]     [PHP SOAP]
  Powered by Linux