网站,无法读取php作为代码?

I have developed an website, and I was using just HTML, JS and CSS codes.
The pages are created like www.example.com/Home, it means no format...
My website was running well before i put this single line php code in it:

<?php include 'PageLoader_ST.php' ?>


Here is the code in screenshoot:
enter image description here



And here is the code read by Browser:
enter image description here
I am a little confused on how can i make it work? I don't wan't to use this format Home.php, is it possible anyway?

A file that should be parsed as php code, must have the file extension .php. There is no way around this.

The url and the real file name on disk must not be the same. Very often (and when you use a framework, almost always) they do not correspond. This is achieved through url rewriting. With an Apache server this is done with a .htaccess file.

You could use it to remove the .php extension.

In order to use PHP two things must happen.

1.) PHP must be installed on your server (I'm assuming apache), you can do this by either installing a windows lamp package (like xampp or wamp. installing standalone on a windows server is kinda tricky) Or if you're using a linux environment you can install PHP along with apache by installing the relevant packages.

2.) Your files must have a .php extension in order to tell the php engine that the file contains php script and it must be run through the engine to parse the scripting.

This is a design element in PHP and it is intentional.

EDIT: after reading your question again it looks like you're trying to have your homepage be mydomain.com/Home instead of mydomain.com/home.php.

Having a file that doesn't have an extension is not how you do that. Your file needs .php, and when you want to display the home page you need to use Apache rewrite rules in order for you to have the "pretty urls" affect for SEO and readability.

You can get around the .php from being visible if you use a folder structure along with 'index.php' files. Apache will look for a default file called index in each directory and use that before any others. For example if folder Home contains a file called index.php, you can still use the URL www.example.com/home/ and your site will still work.

This method will also work with a file named index.html or others.

NOTE: The Home directory can still contain other files that can be linked to but they must be linked to using the URL www.example.com/home/filename.extension