Using postgresql with php under windows/xampp

Ok, somehow I finally solved the problem:

I reinstalled xampp and postgres but used postgres 32bit-version (The 64bit-version should also work, but i wanted to ensure)

Then I enabled the extensions in php.ini again:

extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
extension=php_pgsql.dll

I got the error that the file hasn't been found again (php_error_log).

After reading this:

http://postgresql.1045698.n5.nabble.com/pgAgent-installation-fails-LIBPQ-DLL-is-missing-PostgreSQL-9-0-2-x64-2008-Windows-Server-x64-td3351434.html

I downloaded libpq.dll from postgres 8.4 and copied it both in apache/bin and postgres/lib (replaced the dll from there).

In my Path-Variable there's still C:\xampp\php\ext\, but it should work without that part too.

I worked on this problem for 3 days and I hope it will help others to get it up and running faster.


Another solution for this is copying

c:/xampp/php/libpq.dll

to

c:/xampp/apache/bin/

Source