Web Hosting Talk







View Full Version : Postgres and pgAdmin on a Raq4r


microsol
08-21-2001, 07:49 AM
Hi,
just compiled PHP4.0.6 with pgsql=shared.
Now trying to use my pgAdmin installation i get the following error: "Fatal error: Call to undefined function: pg_connect() in /home/sites/home/web/support/db/pgsql/lib.inc.php on line 196"
I've read throught the pgAdmin faq: Q: Why do I get: "Fatal error: Call to undefined function: pg_connect() in lib.inc.php on line ***"?
A: PHP is not compiled with the pgsql extensions on your server. You must either recompile PHP or install the binary/RPM which has postgres capabilites.


That's very strange because i made SHURE that i compiled the postgres extensions into my PHP.

What could cause this?

microsol
08-21-2001, 10:03 AM
Hmm,
any Postgres guru around? I have more questions than that one above.
Need help because postgres takes the pi$$ with me :angry: :angry: :angry:
Please PM me.
Thx.

afriq
08-21-2001, 02:28 PM
microsol,

The following was posted to the Cobalt RaQ list in Feb 2001 - try this:


Hi,

I had phpPgAdmin problem for RaQ4r servers.

There was no PostgreSQL support as default and I got error as
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fatal error: Call to undefined function: pg_connect() in
/home/sites/home/web/manage/phpPgAdmin/lib.inc.php on line 130
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I recompile PHP Version 4.0.4pl1 as below and now everything is ok.

1. ./configure --prefix=/usr --with-apxs=/usr/sbin/apxs --with-gd
--with-gettext=/usr --enable-safe-mode
--with-config-file-path=/etc/httpd --with-exec-dir=/usr/bin --with-zlib --enable-magic-quotes --with-regex=system
--with-ttf=/usr/lib/libttf.so
--enable-track-vars --enable-xml --disable-debug --with-interbase=shared
--with-pgsql=/var/lib/pgsql --with-ldap --with-imap

2. make clean

3. make

4. make install



I'm sure this will work for PHP 4.0.5 or 4.0.6 ... You may have to be selective with the --with commands (eg. Interbase might not be required, etc).

rgrds,

Johan

ps - if this does not help, post another pm ...

afriq
08-21-2001, 02:40 PM
microsol,

This is my own PHP configuration parameters - note that I did not use pgsql=shared:

./configure --with-mysql --with-apxs --with-pgsql --with-zlib --with-ftp --enable-track-vars --enable-trans-sid

Oh, and do you have a php file containing this line:
<? phpinfo(); ?> If not, create one, and call it something like phpinfo.php. The very 1st section shows the configure command that was used to compile PHP.

Hope this helps,

Johan

nexzt
08-21-2001, 03:43 PM
Here is the config line that we use on all of our raqs.. its stable and everything works fine with it.

'./configure' '--prefix=/usr' '--with-apxs=/usr/sbin/apxs' '--with-gd' '--with-gettext=/usr' '--enable-safe-mode' '--with-config-file-path=/etc/httpd' '--with-exec-dir=/usr/bin' '--with-zlib' '--enable-magic-quotes' '--with-regex=system' '--with-ttf=/usr/lib/libttf.so' '--enable-track-vars' '--enable-xml' '--disable-debug' '--with-pgsql'

It supports everything but Interbase. If you want interbase its not hard to add the extra line.

microsol
08-22-2001, 08:09 AM
Ok thx, strange enough but it worked that way: --with-pgsql
:)