473,387 Members | 1,510 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,387 software developers and data experts.

db2-php on linux

I get the following output from a very simple page which tries to
connect to a db2 database hosted on my linux system, which is also
hosting my apache/php system. I have tried several permutations of the
connect string:
"animals"
"odbc://localhost/animals"
"dbc:/user@keyword/localhost/animals"
all with the same result. the php page is appended after the error
message. The book is singularly uninformative about this message and its
possible causes in this environment. If you have any ideas or pointers
to further information, I would greatly appreciate it.
---------------message/screen shot--------------------------------------
animals
Warning: odbc_connect(): SQL error: [IBM][CLI Driver] CLI0126E Operation
invalid at this time. SQLSTATE=S1011, SQL state S1011 in
SQLSetConnectOption in /var/www/html/test/second.php on line 15
fail
---------------php code-------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd" >
<html>
<head>
<title>First Database Try</title>
</head>
<body bgcolor="#ffffff">
<h1>
<?php
putenv("DB2INSTANCE=db2inst1");
// $cs = "odbc:/uu:pw/localhost/animals";
$cs = "animals";
echo "$cs";
// $res = odbc_connect($cs,"uu","pw");
$res =
odbc_connect($cs,"uu","pw",SQL_CUR_USE_ODBC);
if ( $res===False) {
echo "fail";
}
else {
echo "succeed";
}
?>
</h1>
</body>
</html>
~

Nov 12 '05 #1
2 2678
Hi Robert,

On Mon, 16 Feb 2004 21:54:00 -0500, Robert Stearns <rs**********@charter.net> wrote:
I get the following output from a very simple page which tries to connect to a db2 database hosted on my linux system, which is also hosting my apache/php system. I have tried several permutations of the connect string:
"animals"
"odbc://localhost/animals"
"dbc:/user@keyword/localhost/animals"


$dbname = "animals";
$dbuser = "userid";
$dbpwd = "password";

$conn = odbc_pconnect( $dbname, $dbuser, $dbpwd );

This should do it. It seems that the environment is not set correctly. Have you added
.. /home/db2inst1/sqllib/db2profile
to the apachectl file?

You can find an article on how to set up Apache with SSL, PHP and DB2 on the following site

http://www.evermeet.cx/db2issues/sho...2:28:46.276772

A pdf doc is available there aswell.
--
Helmut K. C. Tessarek
Nov 12 '05 #2
I was having connection trouble on Mandrake 9.2. PHP could connect only
intermittently.

Adding:
. /home/db2inst1/sqllib/db2profile
to /etc/rc.d/init.d/httpd and restarting the httpd fixed the problem. Thus, the
standard Mandrake 9.2 distribution worked after I made the changes mentioned in
my post to this group on 2004-02-13 and this change to the httpd script.

Rick

Helmut Tessarek wrote:
Hi Robert,

On Mon, 16 Feb 2004 21:54:00 -0500, Robert Stearns
<rs**********@charter.net> wrote:
I get the following output from a very simple page which tries to
connect to a db2 database hosted on my linux system, which is also
hosting my apache/php system. I have tried several permutations of the
connect string:
"animals"
"odbc://localhost/animals"
"dbc:/user@keyword/localhost/animals"

$dbname = "animals";
$dbuser = "userid";
$dbpwd = "password";

$conn = odbc_pconnect( $dbname, $dbuser, $dbpwd );

This should do it. It seems that the environment is not set correctly.
Have you added
. /home/db2inst1/sqllib/db2profile
to the apachectl file?

You can find an article on how to set up Apache with SSL, PHP and DB2 on
the following site

http://www.evermeet.cx/db2issues/sho...2:28:46.276772

A pdf doc is available there aswell.


Nov 12 '05 #3

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

Similar topics

2
by: mb12036 | last post by:
All- Having a problem installing a DB2 client on a machine running AIX version 5.0. Client appeared to install one time succesfully, then was uninstalled and a reinstall was attempted. For...
4
by: Dani | last post by:
Hi everyone Description of the problem: Using a PreparedStatement to write down an integer (int) plus a timestamp for testing purposes. When read out again the integer looks very different. We...
0
by: richardshen | last post by:
My DB2 V8 SP5 WSE crash on Windows 2003 with the following msg in db2diag.log. Any idea? Looks like I need set stackreserver, what is the suggested value for that? 2004-03-05-12.20.46.299000 ...
0
by: DB2usa | last post by:
Hi, Here is a non-profit website about DB2 for z/OS and OS/390 (IBM mainframes): http://www.db2usa.r8.org or http://db2usa2.free.fr/eliendb2.htm Last update on Tuesday, June 1st 2004
0
by: richardshen | last post by:
Any suggestion about this? DB2 V8.1.5 WorkGroup Edition on Windows Professional 2000. Thanks. Message in DB2Diag.log 2004-07-18-16.54.29.479000 Instance:DB2 Node:000...
1
by: Massimiliano Campagnoli | last post by:
Hi All, I know that db2 V7.2 is no more supported and nor OS/2 is supported anymore but I wonder if someone here can give me some help on this. Platform: DB2 V7.2 FixPak 14 OS: OS/2 (actually...
5
by: news.cyberlink.ch | last post by:
Hi, We have a DB2 version 7 fixpack 14 installed on Windows 200 at a customer site that is crashing at regular intervals.Everything was working fine for over many years, now since about one...
2
by: wugon.net | last post by:
Problem: after inser trigger encounter error sql0348 Env:db2 v8 + fp 13 + win xp Description: we build two after insert triggers DB2.TRG1, DB2.TRG2 on base table DB2.TEST1, insert data into...
3
by: Anoop | last post by:
Is it true that there are no type 4 jdbc drivers to connect to a DB2 server v7.1? The DB2 server is hosted on ACF2 (OS/390). We would be connecting from windows and solaris boxes. If it is true,...
5
by: jbenner | last post by:
I have opened a PMR for this with IBM, and am not asking for advice from the DB2 DBA community. I am posting this as an FYI that DB2 Health Monitor, even at the latest version of DB2, still can cause...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.