Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

http://www.socialblogr.com/2010/08/how-to-install-php-monggodb-monggo-driver-on-linux-ubuntu.html

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: superuser.com/questions/425181/… –  Hermann Ingjaldsson May 16 '12 at 13:34
add comment

1 Answer 1

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

LoadModule php5_module        libexec/apache22/libphp5.so

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 libphp5.so 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
add comment

Your Answer

 
discard

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.