I am trying to use pgsql extension on Windows 10 64-bit (WAPP).
- restarted Apache
- uncommented all postgresql extensions in
pgsql.dllto Apache bin (I tried both dll from php folder and from postgresql)
But still no result.
pgsql is visible only in
php.exe -m but not in
My php version is
7.1.8 and PostgreSQL is
9.6 and Apache is
php.exe -m output:
What can be the problem?
Okay, after a few hours of looking, I found the problem and was able to solve the problem with the pdo_pgsql and pgsql modules not showing in phpinfo().
After uncommenting the extensions in php.ini, go into httpd.conf and add at the top of all the LoadModule lines the following:
LoadFile “C:/Program Files/PostgreSQL/9.6/bin/libpq.dll”
(assuming you are using the latest version of PostgreSQL, otherwise change the number to the version you are using).
Save and restart Apache. Go to phpinfo() and you will see it is loaded.
Apache is unable to see the libpg.dll even if you copy it into the Apache/bin folder.
- Windows Server 2016 (works for Windows 10 as well)
- Apache 2.4.26
- (x64) PHP 7.1.8 (x64 ThreadSafe VC14)
- PostgreSQL 9.6.4 (x64)