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

Ok so i just installed apache2 and php5 following along with this tutorial

But php isn't working, when i try to view a .php file i just the the entire code, although php is installed and i restarted the server

< ?php phpinfo(); ?>
share|improve this question
a very related question:… – Hermann Ingjaldsson May 16 '12 at 13:34

Have checked that your apache conf file is loading the module? You should have a line something like this:

LoadModule php5_module        libexec/apache22/

The paths may be different on your machine. But often package installers will add the correct line, but leave it commented out.

share|improve this answer
just checked /etc/apache2/apache2.conf nothing about a php5_module. Should i add it myself ?Whats the exact line – andrei May 31 '11 at 13:03
exact line depends on where you installed the php module. Have a look at the rest of the LoadModule lines and check if you installed the the in the same place. The above line has a relative path (relative to the ServerRoot in your apache config file. You can also specify an absolute path if it's somewhere else. But handiest to keep them all together usually. – barryj May 31 '11 at 13:13
andrei@ubuntu:~$ sudo a2enmod php5 Module php5 already enabled – andrei May 31 '11 at 13:20
Have you an AddType line? AddType application/x-httpd-php .php – barryj May 31 '11 at 13:26

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.