Configuration layout
For each major release N of PHP (where N is 4 or 5), each of the 4 SAPI's (apache/apache2/cgi/cli) have a different central configuration file /etc/phpN/$SAPI/php.ini.
Additionally, each SAPI is configured with the compile-time option
--with-config-file-scan-dir=/etc/phpN/$SAPI/conf.d
which for all SAPI's is actually a symlink pointing to a central directory /etc/phpN/conf.d. Any file found in this directory ending in .ini will be treated as a configuration file by the PHP SAPI.
The rationale with this method is that each SAPI can thus be identically configured with a minimal amount of conffile handling, but at the same time if you want to have SAPI-specific configuration, you can just remove the symlink.