# Apache2: Activate PHP

## CoderMan

Hi.  I'm trying to set up a small apache2 server with PHP, as a testing box. I'm rather rusty as its been nearly a year since a last set up Apache (on a Fedora box) and the configuration on Gentoo seems to be different. I installed apache2 itself, and that seems to working fine and serving html out of /var/www/localhost/htdocs. Now I need to get PHP to work. I installed dev-lang/php with the apache2 flag, and I'm trying to modify the httpd.conf to load the right module, but I can't seem to find a libphp5.so file or anything similar on my system.

----------

## Veldrin

edit /etc/conf.d/apache2, and append -D PHP5 too APACHE2_OPTS

V.

----------

## Mad Merlin

Add -D PHP5 to APACHE2_OPTS in /etc/conf.d/apache2.

----------

## CoderMan

Blast... I thought I had built PHP with the apache2 flag, but I ran emerge --info dev-lang/php, and apparently not. Perhaps I am losing my marbles. Rebuilding now...

----------

## CoderMan

That did the trick.   :Very Happy: 

----------

