Apache doesn't execute script of index.php in root automatically
The order of the defined 'directory index' files also determine their priority.
In your situation, if both an index.html
and a index.php
are present, Apache will pick the index.html
.
To change this, change the order of the 'directory index' files;
DirectoryIndex index.php index.html
Read the documentation here:
Don't put comma (,) between index.html and index.php and as it is said by "thaJeztah" the order in the directive DirectoryIndex is important and it defines the file that will be served if there is the two files index.html and index.php in the requested directory:
If you want to give priority to index.html write this:
DirectoryIndex index.html index.php
If you want to give priority to index.php write this:
DirectoryIndex index.php index.html