Home > Article > Backend Development > Why isn\'t my index.php loading by default in my CentOS Apache/PHP setup?
Troubleshoot Index.php Loading Issue in CentOS with Apache and PHP
Question:
Why is my website index.php file not loading by default?
When accessing http://example.com/myapp/, users encounter a "forbidden" error. However, accessing http://example.com/myapp/index.php directly displays the correct content.
Answer:
Configurational Requirement for Index Recognition:
Apache Configuration Fix:
To resolve this issue, configure Apache to recognize index.php as an index file. Follow these steps:
DirectoryIndex index.php
Note:
The above is the detailed content of Why isn\'t my index.php loading by default in my CentOS Apache/PHP setup?. For more information, please follow other related articles on the PHP Chinese website!