I am trying to get a PDO connection (php 5.4) on Windows 7 (64 bit) to connect to iSeries IBM AS/400. My end goal is to use Yii2, which uses PDO.
For PDO driver compatibility, I used php5.4, since php5.5 couldn't load the PDO extension for IBM_DB2. I originally had the the IBM DB2 odbc driver running with PDO, using the following connection string:
try {
$dbc = new PDO("ibm:DRIVER={IBM DB2 ODBC DRIVER};
DATABASE=MYDB;"."HOSTNAME=myhost;", "myuser", "mypassword");
} catch (PDOException $e) {
print "Error!: " . $e->getMessage(). "<br/>";
die();
}
...but I was getting connection errors from the host. Maybe that is the wrong driver for iSeries?
I then found an iSeries Access ODBC driver in the install for IBM i Access for Windows, and thought this might be the driver needed instead. I had to do a system restore to get the iSeries Access ODBC driver working, but the restore uninstalled the other IBM DB2 ODBC driver. The iSeries Access ODBC driver now appears correctly.
However, now the PDO extension failed to load. It complained about db2cli.dll missing. In trying to fix thsi, it also re-installed the old IBM DB2 ODBC driver connection. Note: I am still getting the error message.
1) Will the IBM DB2 ODBC driver work with iSeries, and I just have the connection string wrong?
2) Does the missing db2cli.dll message indicate the PDO connectivity is indeed tied to the IBM DB2 ODBC driver? I am wondering if the iAccess ODBC driver can/should be used with the PDO extension.
Any help is appreciated. Thank you.