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
php and DB2
Moderator: General Moderators
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Re: php and DB2
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
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?
;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?
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Re: php and DB2
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
The folder php does not exist in the structure of the folder apache.
The structure look as follows (c.f. attachment):

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?
The structure look as follows (c.f. attachment):
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?
- Attachments
-
- Snap_ 2008-06-12 00.37.27.png (7.51 KiB) Viewed 794 times
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
Re: php and DB2
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
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
phpinfo() shows the exact location of php.ini file used. You don't have to search for it.