Bug #68646 [Nab]: Cannot load pgsql extension

From: Date: Thu, 25 Dec 2014 15:11:00 +0000
Subject: Bug #68646 [Nab]: Cannot load pgsql extension
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189199@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68646&edit=1 ID: 68646 User updated by: tony at marston-home dot demon dot co dot uk Reported by: tony at marston-home dot demon dot co dot uk Summary: Cannot load pgsql extension Status: Not a bug Type: Bug Package: PostgreSQL related Operating System: Windows 7 PHP Version: 5.6.4 Block user comment: N Private report: N New Comment: Yes, I am using 32bit PHP although Windows 7 is 64 bit. I have replaced file "E:\Program Files (x86)\PostgreSQL\9.2\bin\libpq.dll" with the latest one from the PHP installation, and the extension is working now. Many thanks. Previous Comments: ------------------------------------------------------------------------ [2014-12-25 15:03:24] ab@php.net Ah, my typing error. Not SAPI, but API. As it was showing "different module API" error, so i suppose something went wrong with your overwriting. Also - even within the same minor version some files could have gone or changed. So it's always better not to overwrite, but to replace the whole dir. ------------------------------------------------------------------------ [2014-12-25 15:00:54] ab@php.net Ok, now as you've mentioned libpq.dll, i probably see what is wrong. It is so, that the libpq.dll is supplied with PHP. Please use it. From what i can see, the libpq.dll from the postges distribution is compiled with VC10 while we use VC11 for PHP 5.5+. It colud be a luck that the method you've described was working at all, but it's definitely not the right way. Ah, and seems you was pulling a 32 bit libpq.dll, does that match your php bitness? Thanks. ------------------------------------------------------------------------ [2014-12-25 14:37:44] tony at marston-home dot demon dot co dot uk I did not change my Apache configuration, nor did I change my postgresql installation. My httpd.conf file contains the same LoadFile "E:\Program Files (x86)\PostgreSQL\9.2\bin\libpq.dll" directive that it did with the previous PHP installation. I did not overwrite the php.ini file as that exists in the C:/windows directory and not the F:/PHP5 directory. Your reference to me using a different SAPI is incorrect. My extension_dir setting remains unchanged at F:/php5/ext I repeat, all I have done is upgrade the files in my F:/PHP5 directory. The pgsql extension no longer shows up in phpinfo() and is therefore not usable. ------------------------------------------------------------------------ [2014-12-25 11:51:53] ab@php.net Also, from what i see in the bug #68645 - ext with different SAPI, and - as you told you was doing an overwrite. That probably something on shouldn't do. Yes, you might be able reuse the php.ini (but check also), but don't do overwrite - replace the dir. I'd advise you to start from backing up your old f:\php5 and extracting new fresh zipball, then putting the old/revisited php.ini in there. Thanks. ------------------------------------------------------------------------ [2014-12-25 11:44:41] ab@php.net With this you see that the pgsql ext itself isn't broken. You need to revisit your configuration under Apache. Please note, that Apache does chroot away from the php dir. So check what you have on the %path% when Apache starts. Also ensure that php.ini has correct path to the extension_dir. Thanks ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=68646 -- Edit this bug report at https://bugs.php.net/bug.php?id=68646&edit=1

« previous php.bugs (#189199) next »