Apache2 + userdir + php – Not working

I just configured a new webserver and wanted to use the UserDir option.
Enabling UserDir gives you the option of placing webfiles in a public_html folder in your home folder. You can access the webfiles through http://yourserver.com/~UserName/.

The problem i encountered was that .php files wouldnt show, they where just downloaded.

Solving the problem was easy, just open php5.conf in /etc/apache2/mods-enabled.

Edit it to replicate the listings below (uncomment the same lines in your config).

Now restart Apache2 with : sudo /etc/init.d/./apache2 restart , and you are good to go.