Before you can connect to an IBM® database server and run SQL statements, you
must set up the PHP environment.
Before you begin
You
must have the following required software installed on your system:
- PHP version 5 or later
- If
your PHP application will connect to a remote IBM database, one of the following products on
the computer where your application will run:
- The IBM Data Server
Client product
- The IBM Data Server Runtime
Client product
- The
IBM Data Server Driver Package product
- The IBM Data Server Driver for
ODBC and CLI product
If your PHP application connects to an IBM database server on the local computer, no
additional IBM data server products
are required.
Procedure
To install the ibm_db2 and pdo_ibm php extensions:
- Copy
the ibm_db2 and pdo_ibm extension files into the
\ext\
subdirectory
of your PHP installation directory. The ibm_db2 and
pdo_ibm extension files can be obtained from the following sources:
- IBM Data Server product
installation path
- PHP Extension Community Library (PECL)
Note: If you installed the IBM Data Server Driver for
ODBC and CLI software,
you must obtain the ibm_db2 and pdo_ibm extension files separately
from the PHP Extension Community Library (PECL).
- If you have thread safe PHP environment, copy the following
extension files from the IBM Data
Server product installation path into the
\ext\
subdirectory
of your PHP installation directory:
- php_ibm_db2_X_X_XXX_ts.dll
- php_pdo_ibm_X_X_XXX_ts.dll
- If you have non-thread safe PHP environment, copy the following
extension files from the IBM Data
Server product installation path into the
\ext\
subdirectory
of your PHP installation directory:
- php_ibm_db2_X_X_XXX_nts.dll
- php_pdo_ibm_X_X_XXX_nts.dll
- Open the php.ini file in an editor
of your choice. Edit the extension entry in the php.ini file
in the PHP installation directory to reference the PHP driver.
- Optional: If the PHP application that is connecting
to an IBM database server is
running in the HTTP server environment, restart the HTTP Server so
the new configuration settings take effect.