Jump to content

index.php files don't show


DummyNewB

Recommended Posts

I have a new Apache 2.2 server with PHP5 installed and everything works great. Except...
If I try to access a directory where the index page has a php extension (index.php) it just lists the directory contents and does not parse the php file automatically. If the extension was html or htm it works fine. If I type in the exact "directory/index.php" it works fine. It just seems that the server will not recognize any php file unless I use the exact file name.  Am I making sense?
How do I tell the server to run/open .html, .htm, .shtml and also .php?

Thanks in advance for your help.

DNB
Link to comment
Share on other sites

Open you httpd.conf file and search for the following line:
[code]DirectoryIndex index.html index.html.var[/code]
Now add a space after index.html.var and add index.php

Now save the httpd.conf file and restart Apache. index.php files should now be run automatically when in a directory.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.