It has nothing to do with your system.
I supose your problem is the way you are calling the PHP files. They have to be served by a web server (Apache), and the path from the browser should look like
http://localhost/yourfile.php.
This is why you see the other PHP pages from some web sites working, because they run a web server that is parsing the PHP files.
In your case the browser is just return you the PHP file without compile it, thats why you get a download message.