Error: No matching DirectoryIndex in Apache

kumkumsharma

Administrator
Staff member
By default Apache looks for index.html file not an index.html file, when it will not get it then you will get below error:

Code:
AH01276: Cannot serve directory /usr/share/phpMyAdmin/: No matching DirectoryIndex (index.html) found.
In apache configuration file you will find below line,

Code:
<IfModule dir_module> DirectoryIndex index.html </IfModule>
It means apache can only work with index.html file and not index.php file.

To resolve this issue you make changes in Apache configuration file.

Code:
vim /etc/httpd/conf/httpd.conf
after that you have to add index.php next to index.html.

Code:
<IfModule dir_module> DirectoryIndex index.html index.php </IfModule>
Save and exit your file with :wq and then don’t forget to restart Apache to make changes reflect.
 
Top