Thread: pg_connect()

pg_connect()

From
"Johann Thoyer"
Date:
Hi everybody,

Excuse me for my bad english...

I've installed Red hat Linux 8.0, and php 4.2.2, apache 2.0.40 and
postgresql are installed automatically.

Apache and php runs very well (i created a file "test.php" with the
instruction phpinfo() and the information appears very well when i load my
page in my browser, in particular i see the configure command of php
and --with-apxs --with-pgsql=shared take part of it).

In an other php file, i try to connect a postgres database with the command
pg_connect.
And it appears in my browser this error message:
Fatal error: Call to undefined function: pg_connect() ...

the file httpd.conf contents:
LoadModule php4_module modules/libphp4.so

the file php.ini contents:
pgsql.allow_persistent= On

what should i do?

Thanks for any help

Johann



Re: pg_connect()

From
Alvaro Herrera
Date:
On Fri, May 23, 2003 at 05:09:32PM +0200, Johann Thoyer wrote:

> Apache and php runs very well (i created a file "test.php" with the
> instruction phpinfo() and the information appears very well when i load my
> page in my browser, in particular i see the configure command of php
> and --with-apxs --with-pgsql=shared take part of it).
>
> In an other php file, i try to connect a postgres database with the command
> pg_connect.
> And it appears in my browser this error message:
> Fatal error: Call to undefined function: pg_connect() ...

You are probably missing one line in php.ini:
extension = pgsql.so

_or_ it's failing to load that shared library for some reason.  Look in
Apache's error_log, maybe there's something there.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Como puedes confiar en algo que pagas y que no ves,
y no confiar en algo que te dan y te lo muestran?" (German Poo)