Connecting Tech Pros Worldwide Help | Site Map

Fatal error: Call to undefined function pg_connect() in

Needs Regular Fix
 
Join Date: Sep 2007
Location: Canada
Posts: 273
#1: Sep 5 '08
I get following error:

Fatal error: Call to undefined function pg_connect() in C:\www\desiorb.dev\public_html\httpdocs\index.php on line 18

said line is to connect to postres pg_Connect....

I also want to tell that:
I am setting up virtual host on my computer, apache works for projects that don't have database support.
I uncomment php.ini file for postgres.
Apache runs fine there is no error.
I have right user name and password entered i am sure about that part.
I re-installed postgres to make sure it works.
I started the database.
I can see databse conenctivtivity in pgAdmin

any other suggestions?

Thanks in advance.
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,733
#2: Sep 11 '08

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


Hi.

This happens when the PostgreSQL module is missing.

Make sure that you uncomment / create the extension line in you php.ini.
Like:
Expand|Select|Wrap|Line Numbers
  1. extension=pgsql.so ; For Unix
  2. extension=pgsql.dll ; For Windows
  3.  
Also, make sure that the file actually exist in the directory specified by the extension_dir directive.

You can look for the PostgreSQL info in the phpinfo() output to see if it has been loaded properly. If you can't find it, it hasn't been loaded.
Needs Regular Fix
 
Join Date: Sep 2007
Location: Canada
Posts: 273
#3: Oct 27 '08

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


thanks,
I actually I was wrong in specifying version number for the php I have installed. I fixed it .
Regards
Reply