Gentoo Linux - Installing Apache2/PHP

As for all installation purposes under Gentoo, Portage will handle the installation of packages and managing dependencies.

Installing Apache2

  • The installation of Apache2 will start with the command:
    • emerge apache
  • To start the server:
    • # / Etc/init.d/apache2 start 
  • The configuration file for apache2 is /etc/apache2/httpd.conf

Installing PHP

  • First of all we must modify tags in the global variable USE before starting the installation. Then start executing the commands:
    • # euse -E apache2 mysql cgi pam ssl xml # emerge -av dev-lang/php
  • Once installation is complete, check that /usr/lib/php5/bin/php-cgi exists. Then restart apache:
  • # /etc/init.d/apache2 restart
Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
This document, titled « Gentoo Linux - Installing Apache2/PHP », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (