php fails because MD2 is no longer supported within openssl (it's considered highly insecure). Upstream already committed a fix to SVN.
Created attachment 219083 [details, diff] php-5.2.12-openssl-1.0.0.diff
Hanno's patch was committed in time for the PHP 5.2.13 release (see the changelog at http://www.php.net/ChangeLog-5.php#5.2.13). PHP 5.2.13 is in the Gentoo tree as well so I guess this bug can now be closed.
php-5.2.13 compiles and is stable - closing.