If your PHP code is not getting executed and see the actual php code in your browser, there might be chances that apache is not set to handle php files.
If you have installed
php, then make sure that it is loaded by
apache is associated with
LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php .php
And you should check your
.htaccess. It may have some configurations that overrided apache’s config.