Local PHP file loads instead of opening in browser

First let me say that I am NOT starting a web server.

I am running a 64-bit version of Windows 7. When I open a php file, the browser loads it, and does not show it as text. I use Notepad ++ for "Launch in Chrome" and it displays correctly in the address bar, but it loads into my download directory. Just a couple of days ago, it worked perfectly and displayed the text of the php file.

I know that you need a web server with PHP installed to display the file correctly, but this is not what I'm trying to do. I just want it to display the php file as text. Then I change the file: /// part of the url to localhost and it works.

+6
source share
2 answers

That, since php differs from html in a server-side programming language, it cannot be run on a computer without a server, and I assume that you do not know what I'm talking about, but here is how you should do it:

+1
source

From what I understand, you do not need to display php, but just open php in text format, as if it opened in notepad ++. This used to be done, but now it's a php file rendering, not just text. try using different browsers !!! Firefox or opera should help you with this. You can get the URL in these or any browsers, as well as

0
source

Source: https://habr.com/ru/post/946546/


All Articles