Environment :
Ubuntu Server 14.04
PHP 5.5.9
Problem :
PHP code showing on the page instead of being executed
Reason :
The reason that I met this problem is because the PHP file I used begin with (<?) instead of (<?php) which the short tag is deprecated by default.
Solution :
Find php.ini in /etc/php5/apache2, make sure the option short_open_tag=On, if not, change if to On.
Another solution more complete from stack overflow : http://stackoverflow.com/a/5121589/740546