I started having his problem with my local virtual host site in XAMPP. Every time I go to php file, it ask me to download the file. I search for solution online, some suggested add module to httpd.conf in xampp but that was of no help.
Turn out it was the .htaccess file. While updating my local directory from remote, I over wrote my local htaccess file and I started getting this error. Firefox would display prompt, do you want to download the php file. Safari on Mac would download the file automatically. After I restored the original .htaccess, the problem is resolved.
Note: If your other site is working but one site is not working, this is most likely the root cause of the problem. Other suggestions are use http://yoursite.test, which may solve the problem as well some user reported.