Connecting Tech Pros Worldwide Forums | Help | Site Map

Fatal error: Call to undefined function pg_connect()

diamond1's Avatar
Newbie
 
Join Date: Nov 2006
Posts: 7
#1: Mar 16 '07
Hi:
How can solve this problem:

Fatal error: Call to undefined function pg_connect()

Thanks in advance

Moderator
 
Join Date: Nov 2006
Location: Boston, USA
Posts: 505
#2: Mar 16 '07

re: Fatal error: Call to undefined function pg_connect()


Which Postgres version are you using?
The client API, is that pgtcl?
Did you compile the server with TCL libraries?
Any other details that could help to understand your environment..?
diamond1's Avatar
Newbie
 
Join Date: Nov 2006
Posts: 7
#3: Mar 16 '07

re: Fatal error: Call to undefined function pg_connect()


I'm tryin to use PHP through dreamweaver8 to make a user interface for postgresql 8.2 database
Moderator
 
Join Date: Nov 2006
Location: Boston, USA
Posts: 505
#4: Mar 16 '07

re: Fatal error: Call to undefined function pg_connect()


Make sure that Postgresql extension is available for you.

You can run phpinfo();, which will give you a lot of information, including all the available extensions. Look for section pgsql which has line items similar to these:

PostgreSQL Support enabled
PostgreSQL(libpq) Version 7.4.8
... ... ... ...


Or you can execute this code:
Expand|Select|Wrap|Line Numbers
  1.  
  2. echo extension_loaded('pgsql');
  3.  
which will print 1 if you have pgsql library available on your server.
diamond1's Avatar
Newbie
 
Join Date: Nov 2006
Posts: 7
#5: Mar 17 '07

re: Fatal error: Call to undefined function pg_connect()


Thanks for response BUT I tried the 2 methods with no result
when I use the second way the page appears empty (NO 1 or 0)

So, what I have to do?????????
Moderator
 
Join Date: Nov 2006
Location: Boston, USA
Posts: 505
#6: Mar 17 '07

re: Fatal error: Call to undefined function pg_connect()


Apparently you don't have this extension available.
If you're running on your own server you should be able to install or load pgsql library.
If not, you may need to contact whoever owns the server.
Newbie
 
Join Date: May 2009
Posts: 1
#7: May 31 '09

re: Fatal error: Call to undefined function pg_connect()


I was having the same problem...the thing is that when you´re using a PHP version above 5.2.5 in windows, you just can´t load the pgsql extension. You gotta install php 5.2.5 or an older version, or just install a newer one and overwrite php_pgsql.dll with the one from PHP 5.2.5. I tested both ways with excelent results.
Hope you can solve your problem...
Reply