I want it to recognize .php files by default. As it is now, having a file called index.php and calling the directory its in, makes it give me an index of... page..
In the folder etc/httpd/ there is a file called httpd.conf. This is the configuration for Apache. You need to find a section that should look like this
Code:
#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
DirectoryIndex index.html
</IfModule>
You need to add one for PHP, but whether it is supposed to look like
Code:
#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
DirectoryIndex index.html index.php
</IfModule>
Or
Code:
#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
DirectoryIndex index.html
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php
</IfModule>
I don't remember. I know that it is fine to have both in there, because I used to and it worked fine.
I do it the first way, too. I think that the order of the arguments is important. So if you have an index.html and index.php files in the same directory, it'll default to whatever is listed first. I always put my index.php argument first because it's less likely to there "by accident."
Comments
#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
DirectoryIndex index.html
</IfModule>
You need to add one for PHP, but whether it is supposed to look like
#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
DirectoryIndex index.html index.php
</IfModule>
Or
#
# DirectoryIndex: Name of the file or files to use as a pre-written HTML
# directory index. Separate multiple entries with spaces.
#
<IfModule mod_dir.c>
DirectoryIndex index.html
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php
</IfModule>
I don't remember. I know that it is fine to have both in there, because I used to and it worked fine.