ticonzero wrote:the issue occurs when I go in the folder and there I right click on the PHP file and I open it with Firefox
This is not surprising, as you dont open the file via HTTP protocoll (which involves Apache as webserver) but simply as file. You could even stop and/or remove Apache and PHP and the right click (or double click) will still open the file with the appropriate tool (either an editor, a browser or whatever you have assigned to the extension .php).
Only if you enter it manually. On right or double click in the windows explorer you will see the file:// protocoll instead of http:// in the browser URL.
So this is not an Apache or PHP issue, neither a browser issue, it behaves as designed.