Support the DB2 database in Yii Framework
- PHP module pdo_ibm or pdo_odbc;
- DB2 Client installed
- Install yiidb2 extension
- Extract the release file under
protected/extensions
- In your
protected/config/main.php
, add the following:
<?php
...
'components' => array(
...
'db' => array(
'connectionString' => 'ibm:DRIVER={IBM DB2 ODBC DRIVER};DATABASE=database;HOSTNAME=hostname;PORT=port;PROTOCOL=TCPIP;',
//or//'connectionString' => 'odbc:DRIVER={IBM DB2 ODBC DRIVER};DATABASE=database;HOSTNAME=hostname;PORT=port;PROTOCOL=TCPIP;',
'username' => 'username',
'password' => 'password',
'class' => 'ext.yiidb2.CIbmDB2Connection',
),
...
),
...