On linux I've found that I explicitly have to add the -c <path to php.ini> with the shell and
PHPIniDir="/etc/php.ini" in php5.conf or httpd.conf otherwise the ibm_db2.so is not loaded.
It doesn't help setting the --sysconfdir=/etc for configure when compiling.
% php -m | grep db2
% php -c /etc -m | grep db2
ibm_db2