Scanning…
A few notes on ODBC connect 2-tier to IBM i that may be helpful.
Driver is available for the following platforms:
For IBM i Access for Windows, run the exe for your platform (64-bit/32-bit)
For the Windows Application Package:
Packaged as zip file like IBMiAccess_v1r1_LinuxAP.zip Zip file contains rpm and debs for various architectures: i386, x86_64, ppc, ppc64, ppc64le
If on rpm-based distro (RHEL, SLES, CentOS, Fedora, openSUSE, …) install the rpm using your package manager:
eg. zypper in ibm-iaccess-1.1.0.3-1.0.x86_64.rpm
eg. yum install ibm-iaccess-1.1.0.3-1.0.x86_64.rpm
Or rpm, but you’ll need to dependency resolution yourself…rpm -ihv ibm-iaccess-1.1.0.3-1.0.x86_64.rpm
If on deb-based distro (Debian, Ubuntu, Mint, …) install the deb (NOTE: debs only currently built for Intel/x86 not POWER) dpkg -i ibm-iaccess-1.1.0.3-1.0.amd64.deb
Run apt-get to install any dependencies and finish configuring things apt-get install -f
Additionally, there are 32bit packages that can be co-installed with the 64-bit packages to enable both 32-bit and 64-bit applications to use the driver. These are suffixed with −32bit on the name
eg. ibm-iaccess-1.1.0.3-1.0.x86_64.rpm
On both Windows and Linux, the driver is registered with the Driver Manager automatically during installation. On Linux, it may not be installed if odbcinst is not found.
To fix, run the following command: odbcinst -i -d -f /opt/ibm/iaccess/unixodbcregistration
On Windows you can use ODBC Data Source Administrator in the Administrative Tools folder of the Control Panel
On Linux, you can create a DSN using the ODBCConfig GUI if your distribution still has it or edit the configuration files manually
First, run odbcinst -j
to show where your paths are:
kadler@kadler:~$ odbcinst -j unixODBC 2.2.14 DRIVERS............: /etc/odbcinst.ini SYSTEM DATA SOURCES: /etc/odbc.ini FILE DATA SOURCES..: /etc/ODBCDataSources USER DATA SOURCES..: /home/kadler/.odbc.ini SQLULEN Size.......: 8 SQLLEN Size........: 8 SQLSETPOSIROW Size.: 8
On this system, system-wide DSNs go in /etc/odbc.ini and user-only DSNs go in $HOME/.odbc.ini
The most minimal configuration needed is:
[<dsn>] Driver = IBM i Access ODBC Driver System = <system hostname>
For a list of DSN options, see this section of the Knowledge Center
On Linux you can verify using isql or iusql:
isql <dsn> <username> <password>
If isql is working there is a good chance that PHP odbc will be working.
<?php $conn = odbc_connect("<dsn>","<username>","<password>"); ?>
Tony “Ranger” Cairns - IBM i PHP / PASE
Kevin Adler - IBM i PASE / DB2 / ODBC