On Debian style distros (Debian, Ubuntu, etc.), you need to:
apt-get update apt-get install php5 /etc/init.d/apache2 restart
After that, your php code gets executed on the server side and html will be returned to browser.
On RedHat style distros (Fedora, CentOS, etc.), you need to:
yum install php5 service apache2 restart
Hope this helps.