Solved

Fatal error: Call to undefined function pg_connect()

Posted on 2009-04-09
3
4,245 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
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 250 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

777 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