473,513 Members | 3,895 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HELP ME OUT : POSTGRESQL

Everytime I try to connect to my postgreSQL server I get this error :

PHP Fatal error: Call to undefined function: pg_connect() in
c:\inetpub\wwwroot\test.php on line 4
Jul 17 '05 #1
6 2971
On Mon, 03 May 2004 15:09:02 +0200, nader wrote:
Everytime I try to connect to my postgreSQL server I get this error :

PHP Fatal error: Call to undefined function: pg_connect() in
c:\inetpub\wwwroot\test.php on line 4


I had the same problem, but I was able to avoid it by using Pear::DB. If
you have a recent version of PHP (4.3(?) and later) Pear is included.
There is a Pear::DB primer at www.onlamp.com/lpt/a/1356. I found it easy
to use and like the idea of being able to use port from MySQL to
PostgreSQL by changing only one parameter in the DB::Connect parameter
list.

HTH
Jerry

Jul 17 '05 #2
On Mon, 03 May 2004 15:09:02 +0200, nader wrote:
Everytime I try to connect to my postgreSQL server I get this error :

PHP Fatal error: Call to undefined function: pg_connect() in
c:\inetpub\wwwroot\test.php on line 4


Obviously you are runnin Posgres on win32. I have expirience
with Postgres on UNIX systems only, but, maybe, I can help.
Is there a psql command available on win32. Can you connect
with it ?

Is the Postgres on the same machine as your web server ?

--
Ask yourself: are you ready for the enterprise ?
Jul 17 '05 #3
You can't connect to postgresql because you are not installed php-postgres
module in your apache-php installation.

Install this module and try again.

--
Mauro Morales M.
mailto:mm*@tierramedia.org
Linux User # 160358

"nader" <na***@infomaniak.ch> escribió en el mensaje
news:40*********************@news.sunrise.ch...
: Everytime I try to connect to my postgreSQL server I get this error :
:
: PHP Fatal error: Call to undefined function: pg_connect() in
: c:\inetpub\wwwroot\test.php on line 4
:
:
Jul 17 '05 #4
Mauro Morales M. wrote:
You can't connect to postgresql because you are not installed php-postgres
module in your apache-php installation.

Install this module and try again.


Yeah this is pretty much the issue (nothing to do with PEAR or whatever).

on windows, all you need to do is:

- uncomment the following line "extension=php_pgsql.dll" in
c:\windows\php.ini

- make sure you copy php_pgsql.dll from the C:\php\extensions to
c:\windows\system32

- restart the web server

on unix, you have to compile it into php.

Jul 17 '05 #5
On Fri, 07 May 2004 12:42:46 +1000, Terence <tk******@fastmail.fm> wrote:
- make sure you copy php_pgsql.dll from the C:\php\extensions to
c:\windows\system32


No, don't do that, set extension_dir properly and leave the DLL there. Don't
start polluting your system directories.

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
Jul 17 '05 #6
leon
1 New Member
I started receiving this condition when upgrading PHP to 5.1.2

What if:
- Apache is running fine
- PHP is configured and working in other areas
- The extension dir is set
- The dll extension for postgres is uncommented
basically everything is fine, except postgres is not loaded when the script is called? The only reason I can think, is that PHP 5.1.2 has a bug.

Is there any other suggestion, other than trying to revert back to an older version?
Apr 26 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1661
by: CY | last post by:
Hello list I hope someone can gave me a hint / advice on this. I wanted a auto-increasement function, similar to sequence, to increase a field. I cannot use CREATE SEQUENCE because it cd_line_no will start again with a new coursedetail. TQ in advance.
6
1997
by: Conrad | last post by:
Greetings, In short: Using a new FreeBSD (4.9) PostgreSQL (7.3) server, can I rescue PostgreSQL data from a hard drive pulled from an older (motherboard just died) FreeBSD (4.??) PostgreSQL (7.??) server? If so, how? The long version:
4
2358
by: Chris Travers | last post by:
Hi all; A few years ago, I set about porting a PHP application from MySQL to PostgreSQL, after realizing that MySQL wasn't going to be able to handle it. In order to do this, I built a light, fast database abstraction layer which conforms to the behavior of the MySQL functions in PHP. This means that a large amount of porting work could be...
2
1645
by: brynk | last post by:
Anyone please help... I'm a newbie on creating functions in postgresql. Here is an oracle package that I'm trying to port to postgresql: CREATE OR REPLACE PACKAGE BODY NewsPkg.NewsTools AS PROCEDURE del_news (i_id IN VARCHAR2) IS
3
2404
by: Froggy / Froggy Corp. | last post by:
Thx for your quick answer too :) Richard Huxton wrote: > > On Wednesday 18 February 2004 20:18, Froggy / Froggy Corp. wrote: > > Hello, > > > > I asked one time for more "benchmark" soft to know where is the cpu > > average, and read the post about optimising the postgresql.conf (and use > > them), but i allways get a load > 1 on...
4
363
by: Shane D. | last post by:
I have tried contacting the list owner, but nobody responds so I am knowingly sending administrative mail to the list. Sorry folks. For months, particularly since February, I have been receiving e-mail that is out-of-date. Since they are relatively old (weeks to months) I cannot say whether or not they are duplicates. A copy of such an...
2
5877
by: Keith Bottner | last post by:
I just reinstalled my system and am in the process of getting PostgreSQL up and running again. During compilation of Postgres I received the following error: .... checking for main in -lunix... no checking for library containing crypt... -lcrypt checking for library containing fdatasync... none required checking for shmget in -lcygipc......
0
1630
by: Greg Sabino Mullane | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This is a PGP-signed copy of the checksums for following PostgreSQL versions: 7.4.5 7.4.4 7.3.7
25
3009
by: Mike Cox | last post by:
Since we have the discussion going, someone mentioned that the group name should be comp.databases.postgresql. I think this is a good name and I'd like to see what everyone thinks of it. There is also the issue of the charter. I would like to get some feed back on what the best charter could be for the revision of the RFD so it is a...
1
2763
by: DarkGiank | last post by:
Hi, im new to csharp and im trying to create a class that can change the application database without no rewriting all connection code... but cause some reason it is not working... it tells me that im not creating the object but im doing it,,, please help im a newbie to c# using System; using System.Collections.Generic; using System.Text;...
0
7270
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7178
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7397
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7563
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7125
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5703
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5102
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3252
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3239
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.