Apache的列出目录中的文件,而不是index.php文件 [英] Apache lists directory files instead of index.php
问题描述
我的Apache Web服务器突然停止了自动服务的index.php文件。它显示direcotry而不是列出。我试着帮助,但没有运气。
My Apache web server suddenly stopped serving index.php files automatically. It shows direcotry listing instead. I've tried helps but no luck.
我htttpd.conf文件包括
My htttpd.conf file includes
<IfModule module_php5>
AddType application/x-httpd-php .php
</IfMOdule>
和
DirectoryIndex index.php index.html
什么可能是错误的,如果以上所有都OK了?
What could be wrong if all above are OK?
推荐答案
我被快速反应感到惊讶,当我第一次问这个问题,然后答复停了!于是我找到了答案,我自己(意外!)。主服务器根目录显示的索引文件很好,它是没有我的用户站点文件夹。
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.
有是在Apache的用户目录中的每个用户一个.conf文件。我加了
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>
成我的用户名和Tata文件,它的工作!
into the file for my username and tata, it worked!
这篇关于Apache的列出目录中的文件,而不是index.php文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!