apache won't serve index.php - lists directory instead


New Member

Messages: 14

<em>Big Hello</em>
to the list, and a big
<em>Thank You!</em>
I have had a server running for over 6 months on 6.3 and have now upgraded to 6.4 entirely helped by posts on forums.freebsd.org, haven't even needed to ask a question!

Could ramble on but problem is this:

My setup:
php 5.2.8​
apache 1.3.39 with Suhosin patch​

.htaccess that has:
DirectoryIndex index.php index.html index.htm
When I browse to web root directory in Firefox (or any browser)
if there is index.html, it will display no problems

The problem comes when there is no index.html but an index.php instead.

I get a directory listing instead!:(

Any ideas on what I can do to .htaccess httpd.conf or php.ini to correct this?




Reaction score: 8
Messages: 76

If you call "index.php" directly, does this work ?

If so, maybe try to check in httpd.conf for something like:

<Directory /the_directory/you_want_to_serve>
AllowOverride None

If that is maybe set and try setting "DirectyIndex" here.


Well-Known Member

Reaction score: 58
Messages: 416

Have you set the mime types and is the module loaded by apache? ie:

LoadModule php5_module <some path>libphp5.so


application/x-httpd-php .php

Otherwise apache doesn't know that it should parse the .php files. Also if you really don't have to I would suggest moving off the 1.3 apache series to the 2.2 series.


New Member

Messages: 14

I can call index.php directly.

I do have the LoadModule php5_module <some path>libphp5.so line

Actually the whole httpd.conf is a little untidy.

Thanks for the pointers, I'll post back what works.