CentOS 7 + PHP7 -- php not rendering in browser

For PHP 7 (May apply to previous versions as well), but I had to do this:

Add this to the bottom of /etc/apache2/apache2.conf or for Centos /etc/httpd/conf/httpd.conf

SetHandler application/x-httpd-php


Fabien's answer worked for me, but apache started to serve css/js files with the wrong mime type. I fixed it adding this at the end of /etc/httpd/conf/httpd.conf

<FilesMatch \.php$>
 SetHandler application/x-httpd-php
</FilesMatch>

That means that PHP isn't enabled in Apache. PHP addresses that here - step 8 should solve your problem.

As an addition: what I usually do on a new install, is install an entire LAMP-server. On Ubuntu, that's done with sudo apt-get install lamp-server^ (note: the caret is not a typo).