473,834 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with configure PHP with IBM-DB2 driver for connecting Apache derby database

23 New Member
Hi All,

I am trying to configure php with IBM-DB2 and I get the followinng when i run the configure command

./configure --with-pdo-odbc=ibm-db2,/opt/IBM/db2/V8.1/

THE OUTPUT:

checking for ODBC v3 support for PDO... yes
checking for PDO includes... checking for PDO includes... /home/knellim/php-5.3.1/ext
checking for selected PDO ODBC flavour... ibm-db2
libs /opt/IBM/db2/V8.1//lib,
headers /opt/IBM/db2/V8.1//include
checking for odbc.h in /opt/IBM/db2/V8.1//include... no
checking for odbcsdk.h in /opt/IBM/db2/V8.1//include... no
checking for iodbc.h in /opt/IBM/db2/V8.1//include... no
checking for sqlunix.h in /opt/IBM/db2/V8.1//include... no
checking for sqltypes.h in /opt/IBM/db2/V8.1//include... no
checking for sqlucode.h in /opt/IBM/db2/V8.1//include... no
checking for sql.h in /opt/IBM/db2/V8.1//include... yes
checking for isql.h in /opt/IBM/db2/V8.1//include... no
checking for sqlext.h in /opt/IBM/db2/V8.1//include... yes
checking for isqlext.h in /opt/IBM/db2/V8.1//include... no
checking for udbcext.h in /opt/IBM/db2/V8.1//include... no
checking for sqlcli1.h in /opt/IBM/db2/V8.1//include... yes
checking for LibraryManager. h in /opt/IBM/db2/V8.1//include... no
checking for cli0core.h in /opt/IBM/db2/V8.1//include... no
checking for cli0ext.h in /opt/IBM/db2/V8.1//include... no
checking for cli0cli.h in /opt/IBM/db2/V8.1//include... no
checking for cli0defs.h in /opt/IBM/db2/V8.1//include... no

So basically, I have installed the DB2 runtime client but there are no header files in that needed for the succesful connection to Apache Derby database.

When i run my connect php script i get error message
SQLSTATE[IM002] SQLConnect: 0 [unixODBC][Driver Manager]Data source name not found, and no default driver specified

PLEASE, anyome who has configured PHP with IBM-DB2 pls help me.. Its urgent!!
Feb 18 '10 #1
20 6218
Dormilich
8,658 Recognized Expert Moderator Expert
how do you connect to the DB?
Feb 19 '10 #2
Markus
6,050 Recognized Expert Expert
Please see this page on php.net.
Feb 19 '10 #3
knellim
23 New Member
I connect to the DB using the CATALOG TCPIP command. My database is located on the same machine.
I start the Derby Network serveri in Opt/Apache/derby/bin by giving
# ./startNetworkser ver&

The database created is named as vcl
Then, I start the DB2 CLI and give the below commands
db2=>catalog tcpip node vclnode remote localhost server 1527
db2=>catalog db VCL at node vclnode authetication server
db2=>connect to VCL user vcluser using vclPassw

This connectd my DB2 client and derby database as I can see tables by giving select command,

Can u help me in connecting PHP with DB2. Thanks....in advance
Feb 19 '10 #4
Markus
6,050 Recognized Expert Expert
@knellim
Did you see my reply?
Feb 19 '10 #5
knellim
23 New Member
I only saw ur last reply asking me how I connect to DB.. I did answer that and i m waiting fr ur resonse...
Feb 19 '10 #6
Markus
6,050 Recognized Expert Expert
That wasn't my reply. See #3.
Feb 19 '10 #7
knellim
23 New Member
oh yaa..i saw that.. I am following the steps now.. I will try it and tell u if thagt worked..
Feb 19 '10 #8
knellim
23 New Member
Hi Marcus,

I have the ibm_db2 driver configured. I made the changes to php.ini file as
extension=pdo.s o
extension=ibm_d b2.so
ibm_db2.instanc e_name=knellim

I have written php file in /var/www/html as
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. // Create the uncataloged connection string
  3.  $DSN = "DRIVER={IBM DB2 ODBC DRIVER};PROTOCOL=TCPIP;"
  4.          . "DATABASE='TEST';HOSTNAME='localhost';PORT=1527;"
  5.          . "UID='knellim';PWD='db2';";
  6. $conn = db2_connect($DSN,null,null);
  7. $sql = "SELECT id FROM resource";
  8. $stmt = db2_prepare($conn, $sql);
  9. $res = db2_execute($stmt, array(10));
  10. while ($row = db2_fetch_assoc($res)) {
  11. print "{$row['id']}\n";
  12. }
  13. ?>
and when i run it I as php connect.php , I get

PHP Warning: db2_prepare() expects parameter 1 to be resource, boolean given in /var/www/html/testvcl.php on line 9
PHP Warning: db2_execute() expects parameter 1 to be resource, null given in /var/www/html/testvcl.php on line 10
PHP Warning: db2_fetch_assoc () expects parameter 1 to be resource, null given in /var/www/html/testvcl.php on line 11

Pls can u help me with this.. Any idea why this is happening..??
Feb 19 '10 #9
knellim
23 New Member
I wrote a simple script for testing my connection
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $database = 'VCL';
  4. $user = 'vcluser';
  5. $password = 'vcluserpassword';
  6.  
  7. $conn = db2_connect($database, $user, $password);
  8.  
  9. if ($conn) {
  10.     echo "Connection succeeded.";
  11.     db2_close($conn);
  12. }
  13. else {
  14.     echo "Connection failed.";
  15. }
  16. ?>

It says Connection failed

Whats the username and password to be given there.. Is it the database user name and passw or DB2 instance username and password??

Please suggest
Feb 19 '10 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1511
by: Befuddled | last post by:
Forgive me, this is probably a very simple problem, but it's new to me. When I attempt to make php 4.3.8, it exits, and I believe the relevant message is: libtool: link: cannot find the library `' I suspect it may be a problem with the Makefile, but more likely, I have failed to configure php correctly. Here's the configure command I used:
2
3760
by: Russell E. Owen | last post by:
I'm trying to build Python 2.3.4 from source on a RedHat Enterprise machine for installation in a net-wide accessible directory /net/python. I tried all of the following variants of ./configure (the first was required for Python 2.3.3 on RedHat 9): ../configure --prefix=/net/python --enable-unicode=ucs4 ../configure --prefix=/net/python ../configure --prefix=/net/python --enable-unicode=ucs2 All of these result in the ominous message...
1
2207
by: | last post by:
Hello, I'm trying to install Python 2.3.4 in AIX 5.2 with gcc 2.9. After a lot of messing around I got the configure script to run using the following command (libm parameter found from python-list archives): configure --with-gcc --with-cxx=g++ --with-libm="" --disable-ipv6 Now I have a problem running make:
1
1498
by: André Amram Duque | last post by:
I have problem with re-install python 2.3.4, when I execute ./configure is appear one message in config.log, follow below : configure:1710: gcc conftest.cc >&5 gcc: installation problem, cannot exec `cc1plus': No such file or directory configure:1713: $? = 1 My gnu/linux is 2.6.8-1-386(debian/sarge) Somebody could help me?
5
2061
by: max(01)* | last post by:
hello. the following code: 1 from Tkinter import * 2 3 class MiaApp: 4 def __init__(self, genitore): 5 self.mioGenitore = genitore 6 self.i = IntVar()
1
2900
by: Amit Gangrade | last post by:
I am trying to make a configure script for a c++ library . The library can be compiled with some optional header files,depending on the users decision . So basically I need to check for the headers in the path that the user gives in the --with-somelibrary-include="somedirectory" . I am appending the path of "somedirectory" to CPPFLAGS and then using AC_TRY_COMPILE macro , I am trying to compile a program which includes those optional...
18
3172
by: perseus | last post by:
It is really crazy! I need to use the Boost filesystem for the manipulation of directories, and I have no idea how to install this filesystem on my IBM-compatible machine. Does anyone up here know how to do this? Thanks a million in advance! perseus
4
1898
by: james | last post by:
I have a problem installing Pyhton 2.4.3, running "./configure --with-threads=no" completes, but gives the warning: configure: WARNING: curses.h: present but cannot be compiled configure: WARNING: curses.h: check for missing prerequisite headers? configure: WARNING: curses.h: see the Autoconf documentation configure: WARNING: curses.h: section "Present But Cannot Be Compiled" configure: WARNING: curses.h: proceeding with the...
7
4354
by: plumb and tree | last post by:
I've been trying for days to build 64 bit python with Solaris 10 + Sun Studio 12. Can anyone helpl please. This is how I tried to do build: # ./configure --prefix=/opt/python2.4 --without-gcc --enable-shared checking MACHDEP... sunos5 checking EXTRAPLATDIR...
5
3575
by: srinivasareddynr | last post by:
Hi, I am trying to parse an xml using xpath. I dont have any problem when i try it as a standalone java application, but when I try the same code with in a servlet I am getting the below error. Can any one help me please. I need a solution ASAP. SRVE0026E: -: java.lang.NoClassDefFoundError: javax/xml/xpath/XPathFactory at com.ibm.cod.event.hitsReport.process(hitsReport.java(Compiled Code)) at...
0
9800
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9651
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10516
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10556
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10225
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9339
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5629
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5800
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.