Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache lists directory files instead of index.php

My Apache web server suddenly stopped serving index.php files automatically. It shows direcotry listing instead. I've tried helps but no luck.

My htttpd.conf file includes

<IfModule module_php5>
    AddType application/x-httpd-php .php
</IfMOdule>

and

DirectoryIndex index.php index.html

What could be wrong if all above are OK?

like image 886
mavili Avatar asked Dec 16 '12 03:12

mavili


1 Answers

I was surprised by the quick response when I first asked the question, and then the replies stopped! So I found the answer myself (by accident!). The main server root displayed index files fine, it was my user Sites folder that did not.

There is a .conf file for each user in apache users directory. I added

<Directory "/Users/mavili/Sites/">
    Options Indexes MultiViews FollowSymLinks SymLinksIfOwnerMatch Includes ExecCGI
    DirectoryIndex index.php index.html index.pl index.cgi
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

into the file for my username and tata, it worked!

like image 100
mavili Avatar answered Sep 18 '22 11:09

mavili