Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make PHP work with PostgreSQL on Windows

Status
Not open for further replies.

davidchardonnet

Programmer
Joined
Mar 21, 2001
Messages
167
Location
FR
Hello

My configuration:
Windows 2000 Pro (development platform)
PostgresSQL 8.0.1 + Apache 1.3.33 + PHP 4.3.10

I just left MySQL for PostgreSQL

Unfortunately I get the following error message when I try to connect to the server:

Fatal error: Call to undefined function: pg_connect() in c:\program files\apache group\apache\htdocs\connexion.php on line 10


How can I make PHP work with PostgreSQL on Windows?

Thank you

David
 
You must activate the php_pgsql.dll extension in php.ini

php_pgsql.dll ships with the Zip distribution of PHP for Win32.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
I've done this, but nothing changes. What versions of php/postgresql/Apache did you make work together?
 
I only run PHP on Linux, so it's a bit different for me. I compile from source, for one thing.

Check your logs. It may be that PHP hasn't found the extension.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
David,

why don't you let us see your connection code on line 10? As you know, there are some syntax differences between pg_connect() and mysql_connect().

I use WinXP/Apache 2.0.53/PHP 5.03/PostgreSql 8.0.1 without problems.

TheSofty
 
Did you install PHP as an apache module or a CGI?

Did you compile yourself PHP and apache?

David
 
I installed Apache 2 And PHP 5 and it works now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top