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

androm31

New Member


Messages: 14

#1
HTML:
<em>Big Hello</em>
to the list, and a big
HTML:
<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?

Cheers
 

rghq

Member

Thanks: 7
Messages: 76

#2
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
</Directory>

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

gilinko

Well-Known Member

Thanks: 58
Messages: 416

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

LoadModule php5_module <some path>libphp5.so

and

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.
 
OP
OP
androm31

androm31

New Member


Messages: 14

#4
I can call index.php directly.

>gilinko
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.
 
Top