Re: db2 + php screwy messages -- HELP, please! Robert Stearns <rstearns1241@charter.net> wrote in message news:<10f3hucj039qc7a@corp.supernews.com>...
> I have a persistent but not consistent error occurring in db2 / php
> under apache running on two different servers. I rebuilt the database
> from the ground up, starting with creates and sequential files on a
> second server to no avail. I've tried connecting within sessions to get
> the sequentiality thereof. I rebuilt php (4.3.7) to be sure the latest
> db2 routines (8.1.5) were included. I modified the apache startup script
> to include the db2 environment, as someone recommended. No matter what I
> try I continue to receive the following "messages" on a random basis. At
> times the application runs for hours without a single message; at other
> times I cannot see the first db screen for hours, getting the error
> repeatedly, even after restarting my browser, deleting cookies, etc. I
> am getting some pressure to switch database systems due to my inability
> to resolve this problem. Any (further) help would be GREATLY appreciated.
>
> The screen shot of the message:
>
> -----------------------------------------------------------------
> Warning: odbc_connect(): SQL error: ´6ÿ¿|Ú ¶ 7ÿ¿Û , SQL state
> ýÿÿÿܬ& ýÿÿÿÜ©& Ĭ& ýÿÿÿè:ÿ¿ K/·4;ÿ¿ in SQLConnect in
> /var/www/html/GEM/db.php on line 32
>
> ------------------------------------------------------------------
> Added by my application:
> The odbc_connect parameters were:[animals] [XXXXXXXX] [XXXXXXXX]
>
> Tried 1 times
>
> [ýÿÿÿܬ][strlen(ýÿÿÿܬ)]
>
> Error number ýÿÿÿܬ=X'fdffffffdcac';
> [´6ÿ¿|Ú ¶ 7ÿ¿Û ][strlen(´6ÿ¿|Ú ¶ 7ÿ¿Û )]
>
> Error message ´6ÿ¿|Ú ¶ 7ÿ¿Û =X'b436ffbf7cda1cb6a037ffbfdb03';
> could not connect to animals
>
> ------------------------------------------------------------------
> The 'Tried 1 times' is leftover from trying to loop around the
> odbc_connect several times to see if that would ameliorate the problem.
> Whenever I try this, the app hangs indefinitely for unknown reasons.
>
> While I am new to php / db2, I have had years of experience with
> different database systems, including one roll your own. In addition, I
> have decades of programming / debugging experience and this problem has
> me pulling what little hair I have left out by the roots!
>
> For the curious, here's the failing function:
>
> function conn() {
> global $schema, $database;
> $schema = "is3";
> $database = "animals";
> $dbuser = "XXXXXXXX";
> // $dsn = "Driver=DB2;Server=localhost;Database=$databas e";
> $dsn = $database;
> $dbpwd = "XXXXXXXX";
> $ct = 0;
> // do {
> $dbConn = odbc_connect($dsn,$dbuser,$dbpwd);
> // $ct += 1;
> // if($dbConn==False) { sleep(1); }
> // }
> // while(($dbConn==False) && ($ct<5)) ;
> if ( $dbConn==False) {
> printf("<br>The odbc_connect parameters were:[%s] [%s] [%s]<br>\n",
> $dsn,$dbuser,$dbpwd);
> printf("<br>Tried %d times<br>\n",$ct);
> showerror();
> odbc_close_all();
> die("could not connect to $database");
> }
> return $dbConn;
> }
I'm running php 4.3.4 with the db2 8.1 client base code with apache
1.3 on Redhat 9. Connecting to various db2 8.x databases even at
different fp's doesn't seem to be a problem. Although I'm only using
the system for unit testing its not really getting pounded hard or
anything.
What does your php configure command look like?
Looks like your running Apache 2.x. Did you install it after the
Linux load yourself or take it as it came with the Linux dist? I
canned apache 2.0 and pulled down apache 1.3 and recompiled
everything. Probably shouldn't have to do that but its worked well for
me. |