Solved

Fatal error: Call to undefined function pg_connect()

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
pvcreate issue 5 38
$_GET call between URL 3 43
A responsive image gallery using flexbox 6 22
PHP URL Parameter to simple URL for single folder 5 15
You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

733 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