Background: More or less mastered HTML and CSS; has created a static “draft” off-line site. Now there was a question about the introduction of dynamics into the site. I set up the Open Server to check the dynamic properties of the site and began to learn PHP.

Question: it seems that Open Serer only opens index.php from the corresponding domain folder, but not index.hlml (it is clear: if the site is static and the main page is in HTML, then there is no point in testing the content on the local server). I searched the Internet, but I didn’t find the difference between the HTML home page and the PHP home page. It is clear that the latter, in addition to HTML code, also contains PHP scripts, but which ones? In other words, what should be the minimum content of the index.php page?

  • the latter, in addition to the HTML code, also contains PHP scripts - it is not true, it may or may not contain correctly, everything depends on you here. Open Serer did not use, but I doubt that there this behavior can not be changed. A quick search says I'm right - BOPOH
  • one
    Nothing is different. And the content of the scripts is completely on you - that write, then they will contain. To improve the content of the scripts, I recommend you to read the relevant literature and "shovel" information from the Internet - S. Pronin
  • thanks for the information! By the way, I found out that one more thing was incorrectly said: Open Server opens index.html from the option "my sites", but if you specify a different name for the main page, it will not happen. - Bokov Gleb

2 answers 2

Minimal content index (Although php, even html) Is determined only by HTML syntax (etc.) and by your own desire. Simply using OpenServer assumes that you will use scripts, so it seems logical to use exactly index.php

You can change the index to index.htm by changing the DirectoryIndex parameter in the apache config.

    You can simply "connect" to index.php your index.hlml

    The index.php file in the project root:

     <?php require_once __DIR__.'/index.html';