1

I want to add the line AddHandler application/x-httpd-php5 .php to my httpd.conf file but I can't seem to find it. I tried looking in /etc/apache2 and /etc/apache2/apache2.conf but with no luck. Would I just add the line to the apache2.conf file?

Ph33ly
  • 663
  • 3
  • 13
  • 29

1 Answers1

0

If you are on a Debian distro (such as Ubunto) you can find the location of Apache server using following commands:

ps -ef | grep apache

Look for the location of Apache program, then run the following command:

$ /usr/bin/apache2 -V

This will give you the location of apache2.conf. Alternatively you can just search for the file:

$ find / -name 'httpd.conf' -print

And, yes! you can add the line to Apache2.conf too. But make sure that MIME module is enabled too. Usually, it is enabled, but just to make sure look at apache2.conf or httpd.conf and uncomment the following line:

LoadModule mime_module libexec/apache2/mod_mime.so
bman
  • 5,016
  • 4
  • 36
  • 69
  • Thanks! How would I make sure MIME mode is enabled? – Ph33ly May 03 '15 at 01:43
  • Thanks so much for your help! I feel bad for asking again but where exactly can I find `LoadModule mime_module libexec/apache2/mod_mime.so`? I checked apache2.conf and the httpd path (/etc/apache2) doesn't have a httpd.conf. Do I need to create an httpd.conf and and insert the commands there? Some other solutions say that httpd is commented out in the apache2.conf but it doesn't seem to be there either – Ph33ly May 03 '15 at 02:19
  • No problem at all. Just add the line to the end of `apache2.conf`. Different linux distros have different configuration for their Apache. Sometimes there is only apache2.conf and sometimes there are both `apache2.conf` and `httpd.conf`. One includes the another. – bman May 03 '15 at 02:22
  • Ah that makes sense. Thanks again! Ultimately I was trying to solve this (http://stackoverflow.com/questions/30008505/http-response-is-entire-php-file/30008539?noredirect=1#comment48135991_30008539). I'm still getting the same problem but I least I know I have the handler right – Ph33ly May 03 '15 at 02:44