# [SOLVED] apache and php wont work

## pwd

hi all,

i've a problem getting php to work with apache.

use flags include php, cgi, /etc/conf.d/apache2 contains "-d PHP5" in apache2_opts. php files dont interpret in /var/www/localhost/htdocs (here the content is printed) nor /var/www/localhost/cgi-bin (500 server error) which *also* wasnt created at apache emerge.

is there an official apache installation guide which includes the php-setup?Last edited by pwd on Mon Jun 07, 2010 1:01 pm; edited 1 time in total

----------

## nativemad

Hi, 

actually there are different ways to use php under apache and you seem to mix them up a bit!  :Wink: 

The "-D PHP5" in /etc/conf.d/apache is used for mod_php, which you get if you set apache2 as useflag for php!

Cgi is another method to use php and others. This is the Default for other webservers like lighttpd or nginx, but can also be used in different variations with apache (mod_suphp, mod_fcgid or mod_fastcgi as example). 

I would go for the first option, as it's much easier to setup for the first time!  :Wink: 

Hope that helps, 

Cheers

----------

## pwd

 *nativemad wrote:*   

> set apache2 as useflag for php

 

ARRRRGH!

thank you  :Smile: 

the power of reverse logic never underestimate you must.

----------

