Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just installed Apache, php and MySQL manually in windows 8. It works fine

but the problem is when i try to open the directory in browser it auto opens index.html but not index.php

for ex: i have following folder structure


if i access "localhost/folder1/index.php" it loads fine, but if i access"localhost/folder1" then it will show all the files and folder in that folder.

Is there anyway I can make localhost open index.php open automatically and not show files inside that folder?

share|improve this question
You installed a bunch of *nix-native technologies on a developer preview of Windows that's not slated to be released for over a year? There's no way this is on topic. – MDMarra Nov 11 '11 at 20:28
up vote 2 down vote accepted

Check that the DirectoryIndex directive is set correctly in you apache configuration file e.g.

DirectoryIndex index.html index.cgi index.php index.xhtml index.htm

share|improve this answer
thank you very much – sonill Nov 10 '11 at 3:54

locate your server config DirectoryIndex definition in apache config file(s) and add index.php to whatever is already there. you can also have a DirectoryIndex per vhost. Or per directory. or inside a .htaccess. see mod_dir directoryIndex documentation

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.