Connecting Tech Pros Worldwide Help | Site Map

Fatal error: Call to undefined function pg_connect()

  #1  
Old March 16th, 2007, 07:05 PM
diamond1's Avatar
Newbie
 
Join Date: Nov 2006
Posts: 7
Hi:
How can solve this problem:

Fatal error: Call to undefined function pg_connect()

Thanks in advance
  #2  
Old March 16th, 2007, 07:16 PM
Moderator
 
Join Date: Nov 2006
Location: Boston, USA
Posts: 505

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..?
  #3  
Old March 16th, 2007, 09:14 PM
diamond1's Avatar
Newbie
 
Join Date: Nov 2006
Posts: 7

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
  #4  
Old March 16th, 2007, 10:05 PM
Moderator
 
Join Date: Nov 2006
Location: Boston, USA
Posts: 505

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.
  #5  
Old March 17th, 2007, 06:53 PM
diamond1's Avatar
Newbie
 
Join Date: Nov 2006
Posts: 7

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?????????
  #6  
Old March 17th, 2007, 07:16 PM
Moderator
 
Join Date: Nov 2006
Location: Boston, USA
Posts: 505

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.
  #7  
Old May 31st, 2009, 02:29 AM
Newbie
 
Join Date: May 2009
Posts: 1

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fatal error: Call to undefined function pg_connect() in creative1 answers 2 October 27th, 2008 08:03 PM
postgres 7.3.3 on redhat 7.2 Daniel E. Fisher answers 3 November 12th, 2005 12:23 AM
pgsql error - situation update Daniel E. Fisher answers 1 November 12th, 2005 12:20 AM
"Call to undefined function pg_query_params() ..." Ryan Lange answers 1 August 19th, 2005 10:05 AM