简体   繁体   中英

Connecting PHP with DB2 on linux

I get a connection failed message when trying to connect to db2 database in php, the code is run on a linux server..

I have added the instance and extension lines in php.ini


ibm_db2.instance_name=db2inst1

[ibm_db2]

extension=ibm_db2.so

I am I missing something in the php.ini file or any other file?

Note I am following the following steps:

http://www.php.net/manual/en/ibm-db2.installation.php

http://www.php.net/manual/en/ibm-db2.requirements.php

I get the following error messages in the httpd/error_log

[Mon Jun 30 15:35:16 2014] [notice] Digest: done PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/idb_db2.so' - /usr/lib64/php/modules/idb_db2.so: cannot open shared object file: No such file or directory in Unknown on line 0 [Mon Jun 30 15:35:16 2014] [warn] ./mod_dnssd.c: No services found to register [Mon Jun 30 15:35:16 2014] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 configured -- resuming normal operations [Mon Jun 30 16:06:05 2014] [error] [client 192.168.48.121] PHP Fatal error: Call to undefined function db2_connect() in /var/www/html/PhpProject1/index.php on line 14 [Mon Jun 30 16:06:18 2014] [error] [client 192.168.48.121] PHP Fatal error: Call to undefined function db2_connect() in /var/www/html/PhpProject1/index.php on line 14


please check this error message: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/idb_db2.so' You need to have this library physically on disk. Apparently it´s not true in your case :-) Please check (for 10.5) http://www-01.ibm.com/support/docview.wss?uid=swg21385217 and here you can find client+libraries needed (I hope IBM Data Server Runtime Client can solve it).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM