我刚刚安装了CentOS,Apache和PHP。当我访问我的网站http://example.com/myapp/时,它显示“禁止”。默认情况下,它不会加载index.php文件。
当我访问http://example.com/myapp/index.php时,它工作得很好。
你知道怎么解决这个问题吗?
发布于 2010-03-05 11:54:45
根据猜测,目录索引设置为index.html,或某种变体,请尝试:
DirectoryIndex index.html index.php
这仍将使index.html优先于index.php (如果您需要抛出一个维护页面,这将非常方便)
发布于 2014-11-02 22:05:32
这可能会对某些人有所帮助。下面是来自httpd.conf (Apache version2.2 windows)的代码片段。
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.html
DirectoryIndex index.php
</IfModule>
现在,这将查找index.html文件,如果没有找到,它将查找index.php。
发布于 2010-03-05 11:49:25
尝试使用以下内容创建.htaccess文件
DirectoryIndex index.php
编辑:实际上,是不是有一个'php-apache‘包,或者你应该把它们都安装在一起?
https://stackoverflow.com/questions/2384423
复制相似问题