Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm encountring some difficulties with my Apache2/PHP5. All was well-configured and working, but after reinstalling apache2, the PHP files are displayed without being interpreted.

I tried many workarounds like:

AddType application/x-httpd-php .php

in the httpd.conf file, but still get the same issue. Please note that httpd.conf was not changed.

share|improve this question

Are you loading PHP Module ? In your httpd.conf, check :

LoadModule php5_module        libexec/apache2/

Of course, you must change module path, to where your is.

Furthermore, you also need your entry

AddType application/x-httpd-php .php

If you want to use indexes with .php, modify the dir_module condition :

<IfModule dir_module>
    DirectoryIndex index.html index.php

But before running all of that, you could run an apt-get :

 apt-get install libapache2-mod-php5
share|improve this answer
The last line is the important one. The package installer should have done all the detail work for you. If it didn't, try re-installing the package before manipulating the Apache configuration directly. – Oliver Salzburg Feb 21 '12 at 12:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.