1

I am using xampp to build a database. I have written a file in NotePad++ as a php file and tried to open it in Chrome, and all it did was display all the text, unescaped, contained within the notepad file, instead of executing the contents of the file (which was display a deliberate error message). What happened?

JohnnyApplesauce
  • 181
  • 1
  • 2
  • 13

2 Answers2

1

You are using xampp so put your files inside the htdocs folder of xampp folder. Then access the page : localhost/myscript.php in your browser

pr1nc3
  • 8,108
  • 3
  • 23
  • 36
1

Web browsers are not code interpreters. Web servers like Apache or nginx utilize other libraries (in PHP's case its usually PHP-FPM or PHP FastCGI Process Manager). They execute the code and return text which may contain HTML or other content to be displayed to the page which is what the browser gives to you.

bhooks
  • 409
  • 5
  • 16