[英]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.