 <p>There appear to be a number of ways to achieve this but many seem a bit out of date or overly complicated. As of Feb 1 2010 all I did to get PHP and Apache2 working on Gentoo was to install Apache and PHP like this:</p> <ol> <li><code>bash$ emerge apache</code></li> <li>Followed the instructions for the particular extensions I wanted at <a href="http://overlays.gentoo.org/proj/php/wiki/ManagingExtensions" rel="nofollow noreferrer">this list at the Gentoo site</a> <ul> <li>NOTE: this is the important one to get Apache and PHP working together: <ul> <li><code>bash$ echo "dev-lang/php apache2" &gt;&gt; /etc/portage/package.use</code></li> </ul></li> <li>Another common PHP extension: <ul> <li><code>bash$ echo "dev-lang/php mysql" &gt;&gt; /etc/portage/package.use</code></li> </ul></li> <li>And so on.</li> </ul></li> <li>Then just run <code>bash$ emerge dev-lang/php</code> and restart Apache with the /etc/init.d/apache2 script. PHP should now be available.</li> </ol>