First of all, browsers don't "execute" php... ever. the Apache web server and PHP engine work together to do that.
By accessing the file directly from the filesystem you are skipping Apache... thus no execution and rendering. Yes there are tricks to execute the code, but why %^#$%^ bother?
Why not just make your life 10,000% easier and run it through Apache via
http://localhost/ or
http://127.0.0.1/ ?