PHP 5.2.8 is refusing to load php_pgsql.dll
, with the following error:
Warning: PHP Startup: Unable to load dynamic library \'D:\\PHP\\ext\\
LIBPQ.DLL problem with php on Vista...
Check to make sure you actually have postgres installed. If you install php on windows with postgres API, without postgres being installed, you may get this warning. It's too easy to just click everything on the Windows installer...
Comment out the relevant line in php.ini.
Just to share what worked for me, without dealing with libpq.dll
. I uncommented both extension=php_pdo_pgsql.dll
and extension=php_pgsql.dll
in php.ini. At first, apache refused to start.
I then add "C:\Program Files (x86)\PostgreSQL\9.4\bin\"
(depending on your installation) into windows environment PATH, started apache successfully and works.
I found this to work for me:
After installation of PostgreSQL, you need to copy libpq.dll
from wamp\bin\php\phpX.X.X
to wamp\bin\apache\Apache2.2*\bin
. And restart the Wampserver.
I just did this and it worked just fine in php folder inside php.ini I changed this line
extension=php_openssl.dll
to
extension=C:\php\ext\php_openssl.dll
the php_openssl.dll
is inside ext
folder which couldn't be found.
I got the solution:
1) If you want to load php_pdo_pgsql extension, please load php_pdo, too. (in php.ini)
2) php_pgsql.dll and php_pdo_pgsql.dll depend on libpq.dll and php5ts.dll. libpg.dll is the library from postgreSQL, but it has been bundled into PHP's binary package. When configuring PHP to work as a module with Apache, it can't load the depending library correctly. And so you need to load it in Apache.
config in httpd.conf and the two lines should be before LoadModule php5_module
LoadFile "Full path to /php5gs.dll" LoadFile "full path to libpg.dll"
Hope it be helpful.
This happened to me also with PHP 5.4.1
Copying the offending DLL everywhere didn't work, and I don't have PostgreSQL installed in the server, but I also planned to use PHP against different Postgres versions, so the only solution I found that worked was to put in httpd.conf a line like this:
LoadFile "C:/Program Files/PostgreSQL/8.4/bin/libpq.dll"
And referring to the libpq.dll that comes bundled with PHP, like this:
LoadFile "C:/php/libpq.dll"
After that it worked fine to me.