问题
I'm having a hard time finding a php_ibm_db2.dll
extension for PHP7 on Windows. The most recent version on https://pecl.php.net/package/ibm_db2 is from April 2016, so naturally it doesn't work. I've tried downloading a trial of Zend Server 9.1 and using the bundled php_ibm_db2.dll
file in a non Zend Server WAMP stack, but no luck (both for 32 and 64 bit versions).
Has anyone successfully connected to a remote IBM DB2 instance from a non Zend Server WAMP stack using PHP7 and the db2_*()
functions? If so, any advise/suggestions?
Note*: DB2 connect is installed, configured and connecting fine on the Windows machine I'm working on. I would imagine ODBC via PHP would work as well, but I need to use the db2_*()
functions to connect.
回答1:
The pecl repository isn't compiling the dlls anymore, the latest is 1.9.9 for php 5.6 :(
I compiled to myself the ibm_db2 2.0.5 for php 7.1.17
Remember: Install Ibm db2 ds drivers an add {ds_drivers_instalation_dir}/bin to Path env variable.
回答2:
PECL is not generating DLLs from 7.x hence we have generated DLLs for all 7.x version and uploaded same in github directory. So any user can download specific version DLLs from link as per their requirement and can use it.
1) Download the php_ibm_db2 DLLs for PHP 7.x(7.0, 7.1, 7.2) from below link. https://github.com/ibmdb/php_ibm_db2 As of now (x64) DLLs for PHP 7.2 and PHP 7.3 are available. We will upload x86 DLLs soon.
2) For PHP 5.x, Download the DLL from Pecl itself. Pasted the link below. https://pecl.php.net/package/ibm_db2
Blog to install and compile PHP ibm_db2 for Linux and windows is pasted below. https://www.ibm.com/developerworks/community/blogs/96960515-2ea1-4391-8170-b0515d08e4da/entry/Install_PHP_ibm_db2_Driver?lang=en
来源:https://stackoverflow.com/questions/44440812/php-ibm-db2-dll-extension-for-php7-on-windows