Click to See Complete Forum and Search --> : Call to undefined function: pg_connect() PHP APACHE


JenTack225
02-14-2007, 06:49 PM
Hello there,

I've been working on this thing for over 6 hours now and I can't seem to find it. The other posts on here I found via search didn't help either.

I installed apache2 and php5 (from source with dom, domxml, pgsql)
Apache2 starts fine and a phpinfo() outputs fine as the correct 5.2.0 version. Here's the output of the phpinfo for pgsql

PostgreSQL Support enabled
PostgreSQL(libpq) Version 8.1.5
Multibyte character support enabled
SSL support disabled
Active Persistent Links 0
Active Links


My issue is when I try to run a php file I know used to work I get the following error
"Call to undefined function: pg_connect() "

I did a find / -name pgsql.so and there was no file on my server nor was it in mods-enabled in /etc/apache2/ Is that the file I need to get it? I installed php5-pgsql via apt-get too.

Any help at all or even a point in the right direction would be really helpfull.

Syngin
02-15-2007, 01:49 PM
I don't generally do an install like that from source but, in Debian at least, a separate package needs to be installed via apt for the php5 / Postgresql connector. Same with MySQL. I think they are automatically installed these days when you install PHP5 via apt.

I'm pretty sure the function you are calling is normally in this package.

http://packages.debian.org/unstable/web/php5-pgsql

I found this post which may also shed some light on this issue:

http://archives.postgresql.org/pgsql-php/2006-04/msg00024.php

aNoob
02-16-2007, 10:57 AM
You miss pgsql.so in /usr/lib/php5(or what's the directory name)