Skip to content

‘pecl install ibm_db2’ can’t find library

I’m trying to install ibm_db2 through pecl:

pecl install ibm_db2

Then when it asks for an install dir, I have tried various places only to have the same result. It goes through a bunch of checks etc., then tries to ‘make’ and gets an error:

/usr/bin/ld: skipping incompatible /home/db2inst1/sqllib/lib32// when searching for -ldb2
/usr/bin/ld: cannot find -ldb2

It always looks there for the libraries. And they exist, because when I execute:


It displays:


But they’re in /opt/ibm.

I was looking at this link: pecl instal ibm_db2 fails, it seems like it’s something to do with the headers/libraries being configured incorrectly?

I am currently running RHEL 6.6.



So it turns out I didn’t actually need to include these libraries in php.ini or through pecl (doing it that way meant it was looking on a path it couldn’t find for some reason), because they were already set up from my PHP configure command. It put the headers in a certain location , and by making that location available to Apache, the app worked fine, no need to include them in php.ini.

User contributions licensed under: CC BY-SA
6 People found this is helpful