The way I understand it, I have to pick which "modules" I want PHP to use before compiling it. If I want to change those, add new modules or upgrade some then I have to do the ./configure (with scads of options); make; make test; make install dance. At least with perl if I want to upgrade or add DBD::Pg it is separate from the perl core so I'm not forced to do the equivalent of recompiling perl and mod_perl.
You are very confused. PHP offers native support for such things as imap and mysql. This is considered a *good* thing, but you have the choice of compiling php with or without such support. You don't compile PHP with "modules". PHP offers PEAR, which is similar in some respects to CPAN. You should read the FAQs on php.net.