473,410 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

PHP5 and DB2 9.5

We have an older Suse linux server with DB2 v8.2 and PHP 4.4.2. The
PHP was configured --with-ibm_db2 and uses odbc_connect(),
odbc_exec(), odbc_fetch_row(), odbc_result().

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.
http://publib.boulder.ibm.com/infoce.../t0011926.html

Oct 17 '08 #1
2 3315
ch***************@gmail.com wrote:
We have an older Suse linux server with DB2 v8.2 and PHP 4.4.2. The
PHP was configured --with-ibm_db2 and uses odbc_connect(),
odbc_exec(), odbc_fetch_row(), odbc_result().
You are using the functions of php odbc driver, not the ones of
the ibm_db2 driver (its functions start with db2_*()).
So nothing should change if you update your php as long as you make
sure, the odbc driver is included into php.

At least i think so :)

--
MfG, Christian Welzel aka Gawain@Regenbogen

GPG-Key: http://www.camlann.de/key.asc
Fingerprint: 4F50 19BF 3346 36A6 CFA9 DBDC C268 6D24 70A1 AD15
Oct 18 '08 #2
I did yum install php-odbc and then after restarting Apache I had an
"odbc"
section in the page I created using phpinfo().

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

Oct 22 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Christoph Nothdurfter | last post by:
Hallo! I was wondering if my PHP4-Scripts will run under PHP5 (Haeven't tried the beta yet). Does anybody know? Thank you, -Christoph
8
by: Rob Ristroph | last post by:
I have tried out PHP 5 for the first time (with assistance from this group -- thanks!). The people I was working with have a site that uses lots of php objects. They are having problems with...
5
by: Tim Tyler | last post by:
I'm sure this is a FAQ - but I could not find a coherent statement of the answer: Some of my clients want PHP4. Other ones want PHP5. Can I run both PHP4 and PHP5 under the same instance of...
11
by: neur0maniak | last post by:
Hi, I've been eager to try out PHP5, so I've dumped it on my little dev machine. It's running WinXP with IIS5. I've put the php-cgi.exe in the "mappings" page as I'm used to doing with PHP4....
4
by: badbetty | last post by:
Dear Googlers I have installed PHP5 to run on WinXP against Apache 2. It works! ie. I have tested a few simple scripts and a basic xml document parse. I now want to try the XSL extension so I...
5
by: Aziz | last post by:
Hi, I've recently contacted technical service of a web hosting company and asked them wheter or not they're gonna upgrade to PHP5 and MySQL5. Here's a quote from their response which confused me...
4
by: Chuck Anderson | last post by:
I am trying to install Php5 on my WindowsXP machine (at home, not on the 'net). I downloaded the Php Windows binary at php.net, unzipped it to c:/Php5, changed my Apache config file to use Php5...
19
by: McKirahan | last post by:
I am working in two environments neither configuration of which I can change; one's my Web host the other a client. My Web host requires the use of the ".php5" extension to use PHP v5.1.4; where...
3
by: xhe | last post by:
I have just upgraded my php version form php4 to php5. and I met this problem, and don't know if you know the solution. My site was written in PHP4, and most parts can be running smoothly in PHP5,...
8
by: FFMG | last post by:
Hi, I am slowly moving my code to php5. But I would like to make it backward compatible in case something bad happens, (and to make sure I understand what the changes are). The way the...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.