How do I compile ibm_db2 tar for PHP 7 on Windows?

2019-08-24 10:33发布

问题:

I am running PHP 7 in XAMP on Windows 7 and need to use the IBM DB2 driver for PHP

https://pecl.php.net/package/ibm_db2

The DLL drivers only work for PHP 5 so according to php_ibm_db2.dll extension for PHP7 on Windows? I need to compile the tar file to create my own driver. Question is: how do I do that?

回答1:

IBM distributed in August-2017 a pre-built ibm_db for Windows 32-bit, requiring a 32-bit PHP, and a 32-bit Db2-client on Windows - which was not my target.

If you have a 32-bit environment (i.e. 32-bit PHP, 32-bit ibm_db pre-built, and 32-bit Db2-client) maybe you can try that?

It's possible IBM may deliver 64-bit binaries of ibm_db for Windows at some point, if they've not done it already.

In August-2017, I tried a 64-bit build of PHP 7.1.10 and ibm_db2 v2.0.0. The compile completed without errors but I got crashes when using ibm_db. I did not have time to resolve the crashes. Since that time both PHP-7 and ibm_db have been refreshed to higher versions, which may resolve matters.

Your mileage may vary.

I followed tips at the links below:

https://github.com/php/pecl-database-ibm_db2

https://pecl.php.net/package/ibm_db2

https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2

http://www.php.net/manual/en/install.windows.php#install.windows.build



标签: php db2