5

Wampserver has a problem when loading php_pdo_pgsql and php_pgsql modules. After searching on several forums the solution is to download from http://www.bmedon.net/download.html both .dll files and overwrite the existing ones.

The problem is that it didn't work! I checked all php.ini files. I followed http://diego-loquese.blogspot.com/2010/12/conectar-wampserver-con-postgresql.html instructions (which is a summary of all the forums I found).

I am using WampServer 2.2 for Windows x64 with PHP 5.4.3

matt
  • 638
  • 2
  • 10
  • 22

3 Answers3

19

You have to load libpq.dll that comes with php, in the httpd.conf like this:

LoadFile "c:/wamp/bin/php/php5.4.3/libpq.dll"

It worked for me

GDP
  • 8,109
  • 6
  • 45
  • 82
  • Because of the hurry I installed a ubuntu in a virtual and set my environment there. But soon as I have a minute, I will try your solution! Thanks – matt Jul 27 '12 at 15:11
  • I literally cut and pasted that line into the bottom of my http.conf file and everything started working. Thanks! – Jamie Carl Jun 17 '13 at 01:32
  • Excellent of you to point out that the file exists in the wamp php bundle already! – veeTrain Nov 11 '15 at 16:38
7

Just copy the libpq.dll from your php directory to the apache bin directory.

Theodore R. Smith
  • 21,848
  • 12
  • 65
  • 91
0
  1. Install PostgreSQL

  2. Edit php.ini, uncomment “extension=php_pgsql.dll”. Check both the php.ini in the PHP folder and Apache folder

  3. Edit environment variables, add PostgreSQL /bin and /lib directories to Path. This solves the issue of php_pgsql.dll not loading due to it not being able to resolve dependencies.

  4. Done. PHP should now be able to communicate with PostgreSQL.

Yu Guo
  • 371
  • 1
  • 4
  • 13