Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
apache未将index.php作为默认值返回_Apache_Lamp_Digital Ocean_Directoryindex - Fatal编程技术网

apache未将index.php作为默认值返回

apache未将index.php作为默认值返回,apache,lamp,digital-ocean,directoryindex,Apache,Lamp,Digital Ocean,Directoryindex,我最近做了一个预装了灯的DigitalOcean水滴。 去把我的网站(包括index.php)上传到/var/www Apache只是返回了它工作时的状态!页 我必须手动将/index.php添加到我的url 我尝试过的事情: 制作了一个包含“DirectoryIndex.php”的.htaccess文件 将DirectoryIndex.php添加到apache2.conf 在dir.conf中首先设置index.php 制作index.html也没有显示这一点 编辑: 这是我的apache2.

我最近做了一个预装了灯的DigitalOcean水滴。 去把我的网站(包括index.php)上传到/var/www

Apache只是返回了它工作时的状态!页 我必须手动将/index.php添加到我的url

我尝试过的事情:

  • 制作了一个包含“DirectoryIndex.php”的.htaccess文件
  • DirectoryIndex.php
    添加到apache2.conf
  • 在dir.conf中首先设置index.php
  • 制作index.html也没有显示这一点
  • 编辑:
    这是我的apache2.conf文件:

    您缺少以下配置:

    #
    # DirectoryIndex: sets the file that Apache will serve if a directory
    # is requested.
    #
    <IfModule dir_module>
        DirectoryIndex index.php index.pl index.cgi index.asp index.shtml index.html index.htm \
                   default.php default.pl default.cgi default.asp default.shtml default.html \
                   default.htm home.php home.pl home.cgi home.asp home.shtml home.html home.htm
    </IfModule>
    
    #
    #DirectoryIndex:设置Apache在目录
    #请求。
    #
    DirectoryIndex.php index.pl index.cgi index.asp index.shtml index.html index.htm\
    default.php default.pl default.cgi default.asp default.shtml default.html\
    default.htm home.php home.pl home.cgi home.asp home.shtml home.html home.htm
    
    您的apache2.conf中有什么?设置了什么目录?此外,您还将index.PHP设置为目录索引,因此.html页面将不会覆盖PHP索引页面,因为该页面可能重复