FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » PHP and DB2 on an IIS Server
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: PHP and DB2 on an IIS Server [message #172740 is a reply to message #172725] Sun, 27 February 2011 19:32 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On 27/02/11 16:45, Charles Buege wrote:

> Downloaded and copied into the PHP\ext directory php_ibm_db2.dll file.
> I've modified the php.ini to include extension=php_ibm_db2.dll

> But each time I try to use the following code, I get the following error: Fatal error: Call to undefined function db2_connect() in C:\phptest\baredata.php on line 17
>
> <?php
> //Establish connection to database
> $host = "mysystem.mydomain.com";
> $conn = db2_connect($host,"(valid user name)", "(valid password)");

Hmm, sounds like either:

a) file access permissions problem (the dll or the ini file)
b) dll file in the wrong place
c) ini file entry wrong

I had a similar problem under linux where the web server could access
curl functions but I couldn't access them from the command line - in
that case it was because the command line user didn't have read access
to the ini snippet that included curl, but I don't know if php under iis
uses ini snippets or not.

eg in my linux server setup, the dir:

/etc/php5/conf.d

contains files like "curl.ini" which contain text like:

; configuration for php CURL module
extension=curl.so

Then I also have a "cli" and an "apache2" dir under /etc/php5, both of
which contain a link "conf.d" to "/etc/php5/conf.d" and a cli or web
server specific php.ini

Also, is it the same version of IIS as you normally set up php on? Are
there differences eg between IIS6 and IIS7 php installs?

Also, perhaps:

<?php
if (!extension_loaded('db2')) {
if (!dl('php_ibm_db2.dll')) {
die("failed to load db2 extension\n");
}
}
?>

Rgds

Denis McMahon
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: problem with web service
Next Topic: [ANN]VTD-XML 2.10
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 18:26:23 GMT 2024

Total time taken to generate the page: 0.04915 seconds