This is normally due to an improper handler code. In the .htaccess file, you will want to ensure the handler code matches your version of php. If it does not, the php files may try to download instead of process.
The line of code will look something like this: AddHandler application/x-httpd-php52 .php
The PHP version might be different. Try disabling your .htaccess file and see if that helps. You can also try changing the PHP version as well.
Once your issue is resolved,
please be sure to come back and click accept for the solution