Posted by: gerritvisagie on: July 5, 2011
Ever installed a apache php5 server on ubuntu only to find that it is prompting you to download the pages instead of viewing them?
Well this is because you web server is not recognizing the .php extension.
To enable libapache2-mod-php
Run
sudo a2enmod php
and force reload with
/etc/init.d/apache2 force-reload
If you receve an error where the server says that the librairy could not be found try running
apt-get install libapache2-mod-php5
/etc/init.d/apache2 restart
Another fix if the problem persists:
cd /etc/apache2
Go into mods-available, scroll down to php5.conf and php5.load
Copy php5.conf and php5.load to mods-enabled:
cp php5.conf etc/apache2/mods-enabled
cp php5.load etc/apache2/mods-enabled
After that Restart your Web-server
sudo /etc/init.d/apache2 restart