We have a new Redhat (RHEL5) server with DB2 Workgroup Edition v9.5
installed, and PHP 5.1.6 already installed. I’d like to get my
existing PHP code to work on the new server but I’m not sure exactly
what steps to take and if it’ll work.
Reading this made me think I need to set up PHP from scratch, but it
has a PDO example not --with-ibm_db2.
Thoughts?
Since that would still require a rewrite, and you're on RedHat, did you
try:
yum install php-odbc
No idea wether it will link to DB2, but worth a try if it saves you a
rewrite.
--
Rik Wasmus
This section shows unixODBC as the library, not DB2 as my old SuSE box
does.
New RedHat "odbc" section of phpinfo():
odbc
ODBC Support enabled
Active Persistent Links 0
Active Links 0
ODBC library unixODBC
ODBC_INCLUDE -I/usr/include
ODBC_LFLAGS -L/usr/lib
ODBC_LIBS -lodbc
Old SuSE "odbc" section of phpinfo():
odbc
ODBC Support enabled
Active Persistent Links 0
Active Links 0
ODBC library db2
ODBC_INCLUDE -I/db2inst1/sqllib/include
ODBC_LFLAGS -L/db2inst1/sqllib/lib
ODBC_LIBS -ldb2
I tried one of my pages that uses odbc_connect() in RedHat and it
failed. Here's the error:
[Wed Oct 22 08:15:12 2008] [error] [client 192.168.32.119] PHP
Warning: odbc_connect() [<a href='function.odbc-
connect'>function.odbc-connect</a>]: SQL error: [unixODBC][Driver
Manager]Data source name not found, and no default driver specified,
SQL state IM002 in SQLConnect in /var/www/html/include/login.php on
line 20, referer: http://192.168.32.24/include/login.php
I'm not sure how to get it to do "db2" odbc. Very confused! Any ideas?
Chris