Not interpreting a script that was accessed via a file:// URL is not a problem, nor a bug nor a feature; it's just how things work.
Apache is an HTTP server. It only handles HTTP requests that come in on TCP port 80 (or whatever port you configure it to listen on) from a connected client.
When you type file:///path/to/file in the address bar, the browser doesn't create an HTTP request or connect to any port on any machine; it looks for /path/to/file in the same way any other program does it, like an editor or a file manager. Just as if you had typed `cat /path/to/file` in a terminal. Apache doesn't have anything to do with it. The kernel won't summon Apache to interpret an arbitrary file just because it looks like PHP code; if it did, you couldn't edit it to begin with.
You need to use an http:// (or https) URL to cause your browser to create an HTTP request and connect to the Apache server.
Bookmarks