HELP ME OUT : POSTGRESQL – PHP

  php

Q(Question):

Everytime I try to connect to my postgreSQL server I get this error :

PHP Fatal error: Call to undefined function: pg_connect() in
c:\inetpub\wwwroot\test.php on line 4

A(Answer):

On Mon, 03 May 2004 15:09:02 +0200, nader wrote:

Everytime I try to connect to my postgreSQL server I get this error :

PHP Fatal error: Call to undefined function: pg_connect() in
c:\inetpub\wwwroot\test.php on line 4

I had the same problem, but I was able to avoid it by using Pear::DB. If
you have a recent version of PHP (4.3(?) and later) Pear is included.
There is a Pear::DB primer at www.onlamp.com/lpt/a/1356. I found it easy
to use and like the idea of being able to use port from MySQL to
PostgreSQL by changing only one parameter in the DB::Connect parameter
list.

HTH
Jerry

A(Answer):

On Mon, 03 May 2004 15:09:02 +0200, nader wrote:

Everytime I try to connect to my postgreSQL server I get this error :

PHP Fatal error: Call to undefined function: pg_connect() in
c:\inetpub\wwwroot\test.php on line 4

Obviously you are runnin Posgres on win32. I have expirience
with Postgres on UNIX systems only, but, maybe, I can help.
Is there a psql command available on win32. Can you connect
with it ?

Is the Postgres on the same machine as your web server ?


Ask yourself: are you ready for the enterprise ?

A(Answer):

You can’t connect to postgresql because you are not installed php-postgres
module in your apache-php installation.

Install this module and try again.


Mauro Morales M.
mailto:mm*@tierramedia.org
Linux User # 160358

"nader" <na***@infomaniak.ch> escribió en el mensaje
news:40*********************@news.sunrise.ch…
: Everytime I try to connect to my postgreSQL server I get this error :
:
: PHP Fatal error: Call to undefined function: pg_connect() in
: c:\inetpub\wwwroot\test.php on line 4
:
:

A(Answer):

Mauro Morales M. wrote:

You can’t connect to postgresql because you are not installed php-postgres
module in your apache-php installation.

Install this module and try again.

Yeah this is pretty much the issue (nothing to do with PEAR or whatever).

on windows, all you need to do is:

– uncomment the following line "extension=php_pgsql.dll" in
c:\windows\php.ini

– make sure you copy php_pgsql.dll from the C:\php\extensions to
c:\windows\system32

– restart the web server

on unix, you have to compile it into php.

A(Answer):

On Fri, 07 May 2004 12:42:46 +1000, Terence <tk******@fastmail.fm> wrote:

– make sure you copy php_pgsql.dll from the C:\php\extensions to
c:\windows\system32

No, don’t do that, set extension_dir properly and leave the DLL there. Don’t
start polluting your system directories.


Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space

A(Answer):

I started receiving this condition when upgrading PHP to 5.1.2

What if:
– Apache is running fine
– PHP is configured and working in other areas
– The extension dir is set
– The dll extension for postgres is uncommented
basically everything is fine, except postgres is not loaded when the script is called? The only reason I can think, is that PHP 5.1.2 has a bug.

Is there any other suggestion, other than trying to revert back to an older version?

LEAVE A COMMENT