Page 1 of 1

php and DB2

Posted: Wed Jun 11, 2008 9:43 am
by bojin
I am relatively new to php and I have one task to accomplish.
Underlying DBMS to my php application is not MySQL, but IBM DB2 and I would like to know how can I access my database from my php script?

I wanted to use db2_connect() function in my script, but when I called it a fatal error occurred, stating that undefined function was called. Perhaps, the better question would be - how can I configure my locally installed php engine, so that I can use that (ant other) php functions from php's DB2 library? Just for the sake of information, I am using Windows XP operating system with xampp 1.6.3a with the php 5.2.3 and apache 2.2.4.

I would appreciate a lot any kind of help.

Best regards,
Aleksandar

Re: php and DB2

Posted: Wed Jun 11, 2008 9:54 am
by superdezign
I think you have to enable those functions in php.ini or httpd.conf. In all likeliness, if you look in those files, one of them will have the line commented that enables DB2 functions.

Re: php and DB2

Posted: Wed Jun 11, 2008 11:27 am
by bojin
On the line 603 in the file php.ini is the following:
;extension=php_ibm_db2.dll
When I uncomment it (i.e. remove semicolon), save php.ini file and restart the server the same error still occurs. So that does not help.

Any suggestions for changes in other files?

Re: php and DB2

Posted: Wed Jun 11, 2008 11:31 am
by superdezign
Make sure that file is in the apache/php/ext folder. If it is, then I'm not sure what else to tell you. o_O

Re: php and DB2

Posted: Wed Jun 11, 2008 5:38 pm
by bojin
The folder php does not exist in the structure of the folder apache.
The structure look as follows (c.f. attachment):

Image

So there are two php.ini files (one in the apache/bin folder and one in the php folder). In both files I have uncommented the line that contains php_ibm_db2.dll. Both folders ext and extension (from the php folder) have .dll file called php_ibm_db2.dll.

Now, I don't know where did I get wrong?

Re: php and DB2

Posted: Wed Jun 11, 2008 9:16 pm
by superdezign
On Windows PCs, the php.ini file can exist in multiple places as well (One of them being the WINDOWS folder, which gets top-priority), but only one is used. Try using phpinfo() to see if it mentions DB2 and, if it does, what it mentions about it.

Re: php and DB2

Posted: Thu Jun 12, 2008 2:01 am
by bojin
phpinfo() doesn't show me any information on DB2. I've searched for php.ini files within the Windows folder, but the search returned zero results.

Re: php and DB2

Posted: Thu Jun 12, 2008 5:50 am
by Weirdan
phpinfo() shows the exact location of php.ini file used. You don't have to search for it.