1

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(); ?>
1

2 Answers 2

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.

4
  • just checked /etc/apache2/apache2.conf nothing about a php5_module. Should i add it myself ?Whats the exact line
    – andrei
    May 31, 2011 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, 2011 at 13:13
  • andrei@ubuntu:~$ sudo a2enmod php5 Module php5 already enabled
    – andrei
    May 31, 2011 at 13:20
  • Have you an AddType line? AddType application/x-httpd-php .php
    – barryj
    May 31, 2011 at 13:26
-1

enable php short code from php.ini

By default short codes are not enabled

or use this <?php instead of this <?

also execute: sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt for ubuntu users

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .