[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Fatal error: Call to undefined function pg_connect()

Posted on 2009-04-09
3
Medium Priority
?
4,496 Views
Last Modified: 2013-12-13
Hi,
I wonder if you could please help.
I installed Debian 5 and setup postgresql and its working fine. But PHP is not working fine.
It does not recognise posgresql functions. Fatal error: Call to undefined function pg_connect()
I looked in etc/php5/config.d/php.ini and even added a line extention extension=pgsql.so and restarted. No difference. I also tryed phpinfo() and it displayed info apart from any thing with postgresql or pg. I tryed to down load php-pgsql but its already a package of debian 5. I am new to this and if you could please explain step by step that would be so nice.
Kind regards
Me
0
Comment
Question by:RaviOptics
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Expert Comment

by:webwyzsystems
ID: 24109013
As well as uncommenting the line in php.ini  you also need to copy php_pgsql.dll to somewhere in the PATH (example:  c:\winnt\system32). The php_pgsql.dll DLL should be in your PHP installation somewhere, you'll have to search for it.

You shouldn't ever need to ADD anything to the php.ini file. It has everything generally needed. You only need to uncomment the appropriate lines.
0
 
LVL 6

Accepted Solution

by:
karlwilbur earned 1000 total points
ID: 24173342
You will not need to worry about DLL files since you are not running on Windows. Debian's aptitude (or apt-get) should configure everything exactly as you need it.

If you had to add "extension=pgsql.so" then it was not installed correctly. Are you trying to use PHP as CGI, CLI or an Apache module?

Assuming Apache module, you should see a file "/etc/php5/apache2/conf.d/pgsql.ini" This file would contain the "extension" directive. (this is Debian and Ubuntu specific...not to be assumed for other Linux flavors, MasOS or Windows)

If that file is missing, try this and tell me what you get:

sudo aptitude install php5-pgsql

Open in new window

0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question