PostgreSQL Help

DamnSkippy

Verified User
Joined
Mar 16, 2005
Messages
246
Location
USA, Texas
Howdy, I installed postgresql using RPMs on CentOS 4.3 I followed this how to http://directadmin.com/forum/showthread.php?threadid=14266

I can not connect to it with apache/php using the code in the how to. I get the error Fatal error: Call to undefined function pg_connect() in /var/www/html/pgsql_test.php on line 4

So it seems that php can not use pgsql. I recompiled after editing the config file, restarted apache etc.

Could it be a path issue with the change in the configure.php?

Here is where the RPMs install stuff to:
Executables /usr/bin
Libraries /usr/lib
Documentation /usr/share/doc/postgresqlx.
y.z
/usr/share/doc/postgresqlx.
y.z/contrib
Contrib /usr/share/pgsql/contrib
Data /var/lib/pgsql/data
Backup area /var/lib/pgsql/backup
Templates /usr/share/pgsql
Procedural Languages /usr/lib/pgsql
Development Headers /usr/include/pgsql
Other shared data /usr/share/pgsql
Regression tests /usr/lib/pgsql/test/regress (in the -test package)
Documentation SGML /usr/share/doc/postgresqldocsx.
y.z
 
is the "pgsql" block exists in phpinfo?

"Call to undefined function pg_connect" <- means your php does not compiled with pgsql support...so make sure you edit configure.php and recompile php. You should see the pgsql block in phpinfo.
 
Thanks, I have not been back to this but I did edit the config file and recompile php and zend.

There is no pgsql info in phpinfo though.

I am using Apache 2.2 does that make any difference on the editing of the config files?

What about the path, could that be the issue? I hate to keep recompiling php just to test out different paths LOL.
 
Back
Top