Bug #8769 [Opn]: Can't get ibm_db2 to work with IIS
| From: | larry dot menard at rogers dot com | Date: | Sat, 23 Sep 2006 00:20:24 +0000 |
| Subject: | Bug #8769 [Opn]: Can't get ibm_db2 to work with IIS | ||
| References: | 1 | Groups: | php.pear.webmaster |
| Request: | Send a blank email to pear-webmaster+get-5247@lists.php.net to get a copy of this message | ||
Edit report at http://pecl.php.net/bugs/bug.php?id=8769&edit=1
ID: 8769
User updated by: larry dot menard at rogers dot com
Reported By: larry dot menard at rogers dot com
Status: Open
Type: Bug
Package: Bug System
Operating System: Windows XP, SP2
PHP Version: 5.2.0 RC4
New Comment:
Typo in the repro code... "$userid" should be "$username". Sorry. :-)
Previous Comments:
------------------------------------------------------------------------
[2006-09-22 20:18:16] larry dot menard at rogers dot com
Description:
------------
(I'm actually using PHP 5.2.0RC5-dev, but it is not listed in the
selection box.)
First I had problems getting the ibm_db2 extension to load at all. I
had to grant Read and Execute permission to the "IUSR_CS288290-A"
account (my host name is CS288290-A) on both the "sqllib\bin" and
"sqllib\lib" directories. This should be documented somewhere.
After that I found that even a simple test script does not work when
run against an IIS server.
I know that the db2_connect() is truly not successful because a db2trc
shows no DB2 server activity at all.
And as you can see, the db2_conn_error() does not seem to pick up the
fact that the db2_connect() failed.
It works fine against an Apache server and when run via the command
prompt.
I really would like to get ibm_db2 to work with IIS, but there's no
documentation anywhere regarding this.
Please advise.
Thanks.
Reproduce code:
---------------
<?php
if (key_exists('SERVER_SOFTWARE', $_SERVER)) $br = "<br>";
else $br = "\n";
$dbname = "mydbname";
$userid = "myuserid";
$password = "mypasswd";
printf("Calling db2_connect()...${br}");
$dbconn = db2_connect($dbname, $username, $password);
printf("Returned from db2_connect().${br}");
printf("\$dbconn = ");
var_dump($dbconn);
printf("${br}");
printf("db2_conn_error() returns: ");
var_dump(db2_conn_error());
printf("${br}");
if (db2_conn_error()) // db2_connect() is apparently failing but this
doesn't seem to be returning true
{
printf("Connect failed.${br}");
printf("%s.${br}", db2_conn_errormsg ());
}
else
{
printf("Connect successful.${br}");
db2_close($dbconn);
}
exit;
?>
Expected result:
----------------
Calling db2_connect()...
Returned from db2_connect().
db2_conn_error() returns: string(0) ""
$dbconn = resource(4) of type (DB2 Connection)
Connect successful.
Actual result:
--------------
Calling db2_connect()...
Returned from db2_connect().
$dbconn = bool(false)
db2_conn_error() returns: string(0) ""
Connect successful.
Warning: db2_close() expects parameter 1 to be resource, boolean given
in C:\MyServer\testIISDB2.php on line 52
PHP Warning: db2_close() expects parameter 1 to be resource, boolean
given in C:\MyServer\testIISDB2.php on line 52
------------------------------------------------------------------------
--
Edit this bug report at http://pecl.php.net/bugs/bug.php?id=8769&edit=1