Sometimes installing PHP via the regular method does not help you install PHP properly and even after following the standard methods of installing all you get when trying to enable the PHP5 or the PHP module is this error:
ERROR: Module php5 does not exist!
Scratched your head enough already? Well here is a simple solution to the problem but this involves a bit of manual work to do which is very simple anyways.
All you need to do is create two configuration files like these:
Create a file called php.conf in your /etc/apache2/mods-available/ directory and paste the following code snippet in it and save the file:
<IfModule mod_php5.c> AddType application/x-httpd-php .php .phtml .php5 AddType application/x-httpd-php-source .phps </IfModule>
Now create another file called php.load in the same directory - /etc/apache2/mods-available/ and put the following line in the file and save it:
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
Now from command line, enter the following command and your Apache PHP installation should be back to work in no time at all:
a2enmod php && /etc/init.d/apache2 restart
Please let us know if the above solution worked for you.