PHP5 has the same problem I reported in bug #59203. The problem is that dev-php/mod_php installs /usr/bin/php on top of dev-php/php's version, but the mod_php version uses the wrong php.ini file. The fix is to make sure mod_php doesn't install /usr/bin/php .
Created attachment 43888 [details, diff] example patch to php5-sapi.eclass
59203 is about PHP v4.x?
The patch works fine.
in cvs.