473,574 Members | 2,347 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't get stock Mandrake 9.2 PHP to connect

I can't get PHP to connect to DB2 on the same server.

I'm running both Apache/PHP and DB2 on Mandrake Linux 9.2. I didn't compile
PHP; just installed what appear to be the appropriate RPMs (I don't like to
compile/install and ruin RPM dependencies; I've seen the documents which say to
build PHP "--with-ibm-db2=/home/db2inst1/sqllib"):

unixODBC-2.2.6-4mdk
libunixODBC2-2.2.6-4mdk
php-mysql-4.3.2-3mdk
libphp_common43 2-4.3.3-2mdk
php-ini-4.3.3-1mdk
php-xml-4.3.2-3mdk
php-cli-4.3.3-2mdk
unixODBC-gui-gtk-2.2.6-4mdk
php-cgi-4.3.3-2mdk
php-xmlrpc-4.3.2-3mdk
php-pgsql-4.3.2-5mdk
php-imap-4.3.2-3mdk
php-unixODBC-4.3.3-1mdk
unixODBC-gui-qt-2.2.6-4mdk
php-pear-4.3.2-3mdk
php-ldap-4.3.2-3mdk
apache2-mod_php-2.0.47_4.3.2-2mdk
php-xslt-4.3.2-3mdk
libgtkodbcconfi g0-2.2.6-4mdk

I can't find a Mandrake RPM for php-db2 nor php-ibm-db2.

I've found documentation at:

http://www-1.ibm.com/support/docview...&cc=US&lang=en
http://www-1.ibm.com/support/docview...&cc=US&lang=en
http://publib.boulder.ibm.com/infoce...d/t0006349.htm
http://www.unixodbc.org/odbcinst.html

Some of these appear to conflict, particularly the latter two.

I've tried the methods in both the third and fourth URLs.

No matter what combination of *odbc*.ini files I've tried, I always get:
IM004: [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed

Here are the /etc/odbc.ini and /etc/odbcinst.ini, and /home/db2inst1/.odbc.ini
for this situation:

odbc.ini:
[ODBC Data Source]
mindmeld=IBM DB2 ODBC DRIVER

[mindmeld]
Driver=db2
Description=DB2 Mindmeld DB
Trace=Yes
Tracefile=/tmp/sql.log
Port=3700
Database=mindme ld

odbcinst.ini:
[PostgreSQL]
Description = ODBC for PostgreSQL
Driver = /usr/lib/libodbcpsql.so
Setup = /usr/lib/libodbcpsqlS.so
FileUsage = 1

[db2]
Description = IBM DB2 ODBC DRIVERR
Driver = /var/opt/IBM/db2/V8.1/lib/libdb2.so
FileUsage = 1

/home/db2inst1/.odbc.ini:

[ODBC Data Source]
mindmeld=IBM DB2 ODBC DRIVER
[mindmeld]
Driver=/var/opt/IBM/db2/V8.1/lib/libdb2.so
Description=db2 mindmeld database
Database=mindme ld

The PHP call to connect I'm using is:

odbc_connect("m indmeld","db2in st1","<the right password>");

The db2inst1 user is able to successfully:
db2 connect to mindmeld user db2inst1 using <the right password>

Thanks in advance,

Rick

Nov 12 '05 #1
1 3663
I continued searching, and found http://www.unixodbc.com/doc/db2.html

Based on its info, I put into odbcinst.ini:
DontDLClose = 1

And the following line into my php script:
putenv("DB2INST ANCE=db2inst1") ;

I can now connect and return a result set. :-)

Rick

Rick Hickerson wrote:
I can't get PHP to connect to DB2 on the same server.

I'm running both Apache/PHP and DB2 on Mandrake Linux 9.2. I didn't
compile PHP; just installed what appear to be the appropriate RPMs (I
don't like to compile/install and ruin RPM dependencies; I've seen the
documents which say to build PHP "--with-ibm-db2=/home/db2inst1/sqllib"):

unixODBC-2.2.6-4mdk
libunixODBC2-2.2.6-4mdk
php-mysql-4.3.2-3mdk
libphp_common43 2-4.3.3-2mdk
php-ini-4.3.3-1mdk
php-xml-4.3.2-3mdk
php-cli-4.3.3-2mdk
unixODBC-gui-gtk-2.2.6-4mdk
php-cgi-4.3.3-2mdk
php-xmlrpc-4.3.2-3mdk
php-pgsql-4.3.2-5mdk
php-imap-4.3.2-3mdk
php-unixODBC-4.3.3-1mdk
unixODBC-gui-qt-2.2.6-4mdk
php-pear-4.3.2-3mdk
php-ldap-4.3.2-3mdk
apache2-mod_php-2.0.47_4.3.2-2mdk
php-xslt-4.3.2-3mdk
libgtkodbcconfi g0-2.2.6-4mdk

I can't find a Mandrake RPM for php-db2 nor php-ibm-db2.

I've found documentation at:

http://www-1.ibm.com/support/docview...&cc=US&lang=en

http://www-1.ibm.com/support/docview...&cc=US&lang=en

http://publib.boulder.ibm.com/infoce...d/t0006349.htm

http://www.unixodbc.org/odbcinst.html

Some of these appear to conflict, particularly the latter two.

I've tried the methods in both the third and fourth URLs.

No matter what combination of *odbc*.ini files I've tried, I always get:
IM004: [unixODBC][Driver Manager]Driver's SQLAllocHandle on
SQL_HANDLE_HENV failed

Here are the /etc/odbc.ini and /etc/odbcinst.ini, and
/home/db2inst1/.odbc.ini for this situation:

odbc.ini:
[ODBC Data Source]
mindmeld=IBM DB2 ODBC DRIVER

[mindmeld]
Driver=db2
Description=DB2 Mindmeld DB
Trace=Yes
Tracefile=/tmp/sql.log
Port=3700
Database=mindme ld

odbcinst.ini:
[PostgreSQL]
Description = ODBC for PostgreSQL
Driver = /usr/lib/libodbcpsql.so
Setup = /usr/lib/libodbcpsqlS.so
FileUsage = 1

[db2]
Description = IBM DB2 ODBC DRIVERR
Driver = /var/opt/IBM/db2/V8.1/lib/libdb2.so
FileUsage = 1

/home/db2inst1/.odbc.ini:

[ODBC Data Source]
mindmeld=IBM DB2 ODBC DRIVER
[mindmeld]
Driver=/var/opt/IBM/db2/V8.1/lib/libdb2.so
Description=db2 mindmeld database
Database=mindme ld

The PHP call to connect I'm using is:

odbc_connect("m indmeld","db2in st1","<the right password>");

The db2inst1 user is able to successfully:
db2 connect to mindmeld user db2inst1 using <the right password>

Thanks in advance,

Rick


Nov 12 '05 #2

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

Similar topics

3
1437
by: R.Marquez | last post by:
I tried installing gadfly 1.0 on Mandrake 9.2 and got the following: # python setup.py install running install error: invalid Python installation: unable to open /usr/lib/python2.3/config/Makefile (No such file or directory) # Of course, the error is correct in that there is no such file. There is not even a python2.3/ config...
0
4511
by: Si | last post by:
Hi, I am having trouble with an install of Oracle 9i Release 2 on Linux Mandrake 9.1. I have 512 MB DDR RAM and a Duron 850 CPU. The install appeared to run fairly seamlessly except for a handful of problems : 1) Oracle complained that it could not set the file permissions on four files. They were
2
23024
by: baumann.Pan | last post by:
hi all, I am programming on linux, my program want to connect a oracle database server to do some SQL statement/procedure. But I don't know how to connect to oracle database on linux OS. anyone can do me a favour? thanks a lot
0
1781
by: GH | last post by:
Hi, I've just setup MySQL on a Linux machine and I'm using Visual Basic in Windows to connect to it (using MySQL ODBC 3.51 driver). Everything works fine for browsing the database (used for stock control), but some parts of the VB program refuse to update the database. It was using an Access database (which worked ok) and I'm using the same...
0
606
by: GH | last post by:
Hi, I've just setup MySQL on a Linux machine and I'm using Visual Basic in Windows to connect to it (using MySQL ODBC 3.51 driver). Everything works fine for browsing the database (used for stock control), but some parts of the VB program refuse to update the database. It was using an Access database (which worked ok) and I'm using the same...
9
3723
by: Steve Jorgensen | last post by:
Hi all, I'm working on the schema for a database that must represent data about stock & bond funds over time. My connundrum is that, for any of several dimension fields, including the fund name itself, the dimension may be represented in different ways over time, and may split or combine from one period to the next. When querying from...
10
2150
by: Rhino | last post by:
Has anyone managed to get DB2 V8.1 to install and run on Linux Mandrake 9.1/9.2? I know that IBM does not officially support DB2 on Mandrake but I also know that the clever people who buy DB2 sometimes find a way to do things that aren't supported. Unfortunately, I'm not that clever, especially about installing things. The last time I tried...
0
2412
by: georges the man | last post by:
The purpose: • Sorting and Searching • Numerical Analysis Design Specification You are to write a program called “StockAnalyser”. Your program will read a text file that contains historical price of a stock. The program will allow users to query the stock price of a particular date and output its statistics (mean price, median price and...
6
4006
by: sugapablo | last post by:
I have an old machine running Mandrake 9.2 and PHP 4.3.1 hosting several websites. With the coming changes to daylight savings time in March 2007, what are my options in correcting the current calculation on this machine? Ideal option: RPM patch. Worst option: upgrade OS (it's a very old machine).
0
7828
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...
0
7742
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...
0
8127
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...
0
6493
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...
1
5638
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3765
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...
0
3783
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1362
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1092
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.