mirror of
https://github.com/php/pecl-database-ibm_db2.git
synced 2026-03-23 23:02:16 +01:00
dc392b17ceb5de59390a824522e82dd40245fb66
Procedure to install the ibm_db2 extension in Linux or Unix:
1. Using the export command, set the environment variable IBM_DB_HOME:
$export IBM_DB_HOME=DB2HOME
The DB2HOME is the directory where the IBM Data Server product is installed. For example:
$ export IBM_DB_HOME=/home/db2inst1/sqllib
2. Using one of the following two methods, install the ibm_db and pdo_ibm extensions
- Use the pecl install command included in the PHP Extension Community Library (PECL).
pecl install ibm_db2
pecl install pdo_ibm.(pdo module needs to be installed prior to this.)
- Use the commands included in the source code:
a) Extract the source archive
b) Run the following commands from the extracted directory:
$ phpize --clean
$ phpize
$ ./configure
$ make
$ make install
3. Open the php.ini file in an editor of your choice. Edit the extension entry in the
php.ini file in the <local_php_directory>/php/lib directory to reference the PHP driver:
extension=ibm_db2.so
4. Ensure that the PHP driver can access the libdb2.so CLI driver file by
setting the LD_LIBRARY_PATH variable for Linux and UNIX operating systems
other than the AIX® operating system. For AIX operating system, you must set LIBPATH variable.
5. Optional: If the PHP application that is connecting to an IBM database server is running ini
the HTTP server environment, add the LD_LIBRARY_PATH variable in the httpd.conf file.
Procedure to configure the ibm_db2 extension in Windows:
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
For PHP 5.x, Download the DLL from Pecl. Pasted the link below.
https://pecl.php.net/package/ibm_db2
2. Open the php.ini file in an editor of your choice. Edit the extension entry in the
php.ini file in the <local_php_directory>\php\lib directory to reference the PHP driver:
extension=php_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
Contributing:
See CONTRIBUTING.md
The developer sign-off should include the reference to the DCO in defect remarks(example below):
DCO 1.1 Signed-off-by: Random J Developer <random@developer.org>
Description
⚠️ ARCHIVED: Original GitHub repository no longer exists. Preserved as backup on 2026-01-22T16:21:54.513Z
Languages
PHP
68.4%
C
31.3%
M4
0.3%