簡體   English   中英

獲取index.php列表而不是網站

[英]Getting index.php listing instead of website

我的設置是

Ubuntu 14.04
php 5.x

該網站運行良好。

我將系統升級到:

Ubuntu 16.03
php 7

當我做:

php -v

我得到:

PHP 7.0.22-0ubuntu0.16.04.1 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.22-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies

我有:

Server version: Apache/2.4.18 (Ubuntu)
Server built:   2017-09-18T15:09:02

但是,當我嘗試訪問該網站時,現在在瀏覽器窗口中看到文件index.php的列表。

有任何想法嗎?

您應該在目錄根目錄下添加一個.htaccess文件,其中包含DirectoryIndex index.php index.html行,該行告訴Apache在目錄中時首先使用index.php然后使用index.html ,這就是為什么看到目錄列表的原因index.php

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM