LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   CentOS (https://www.linuxquestions.org/questions/centos-111/)
-   -   IBM/DB2 access via PHP (https://www.linuxquestions.org/questions/centos-111/ibm-db2-access-via-php-4175558834/)

denniswilliams 11-13-2015 08:23 PM

IBM/DB2 access via PHP
 
General questions to start...

Have a requirement to access a remote DB2 database on a AS/400 (an iSeries) system. Also, this is all done through an established VPN connection.

I seem to have the appropriate DB2 driver setup with PHP, at least it reports that it is anyway.

Seems that all my research tells me to use PHP ODBC libraries to achieve this, which leads to my main issue -- getting an odbc connection access established.

I have IBM's i Access software installed, and I get this info currently from /etc/odbcinst.ini...


[iSeries Access ODBC Driver 64-bit]
Description=iSeries Access for Linux 64-bit ODBC Driver
Driver=/opt/ibm/iSeriesAccess/lib64/libcwbodbc.so
Setup=/opt/ibm/iSeriesAccess/lib64/libcwbodbcs.so
Threading=2
DontDLClose=1
UsageCount=1

[iSeries Access ODBC Driver]
Description=iSeries Access for Linux ODBC Driver
Driver=/opt/ibm/iSeriesAccess/lib64/libcwbodbc.so
Setup=/opt/ibm/iSeriesAccess/lib64/libcwbodbcs.so
Driver64=/opt/ibm/iSeriesAccess/lib64/libcwbodbc.so
Setup64=/opt/ibm/iSeriesAccess/lib64/libcwbodbcs.so
Threading=2
DontDLClose=1
UsageCount=1


And...even if any of that is correct, I'm not sure of a proper way to build-out a DSN string for PHP's odbc_connect() functions.

Whenever I check Apache log's for errors, I only get that the connection object (what I check for errors) says that it's an invalid connection object.

Any help/guidance/suggestions would be greatly appreciated.

TB0ne 11-22-2015 12:42 PM

Quote:

Originally Posted by denniswilliams (Post 5449461)
General questions to start...
Have a requirement to access a remote DB2 database on a AS/400 (an iSeries) system. Also, this is all done through an established VPN connection. I seem to have the appropriate DB2 driver setup with PHP, at least it reports that it is anyway.

Seems that all my research tells me to use PHP ODBC libraries to achieve this, which leads to my main issue -- getting an odbc connection access established. I have IBM's i Access software installed, and I get this info currently from /etc/odbcinst.ini...

[iSeries Access ODBC Driver 64-bit]
Description=iSeries Access for Linux 64-bit ODBC Driver
Driver=/opt/ibm/iSeriesAccess/lib64/libcwbodbc.so
Setup=/opt/ibm/iSeriesAccess/lib64/libcwbodbcs.so
Threading=2
DontDLClose=1
UsageCount=1

[iSeries Access ODBC Driver]
Description=iSeries Access for Linux ODBC Driver
Driver=/opt/ibm/iSeriesAccess/lib64/libcwbodbc.so
Setup=/opt/ibm/iSeriesAccess/lib64/libcwbodbcs.so
Driver64=/opt/ibm/iSeriesAccess/lib64/libcwbodbc.so
Setup64=/opt/ibm/iSeriesAccess/lib64/libcwbodbcs.so
Threading=2
DontDLClose=1
UsageCount=1


And...even if any of that is correct, I'm not sure of a proper way to build-out a DSN string for PHP's odbc_connect() functions. Whenever I check Apache log's for errors, I only get that the connection object (what I check for errors) says that it's an invalid connection object. Any help/guidance/suggestions would be greatly appreciated.

You shouldn't need anything special from IBM...in my experience, IBM's software tends to be overly complicated. PHP already has DB2 functionality, which is probably already in the CentOS repositories. Installation instructions are:
http://php.net/manual/en/ibm-db2.installation.php
http://codehole.blogspot.com/2010/02...on-centos.html

..examples:
http://www.ibm.com/developerworks/da...614_scott.html


All times are GMT -5. The time now is 07:47 PM.