只有文件名index.php在apache2上不起作用


only file name index.php is not working on apache2

我在ubuntu上使用apache2。我的localhost运行良好,php也在运行。

但只有文件名index.php不起作用。如果文件名是test.php或index.php以外的任何文件名,它就可以工作。

不知道是apacheprob还是php,有人能帮忙吗?

Thankx,Kamil

避开htaccess文件并编辑http.conf。它也应该是相同的目录索引。添加index.php,看看是否可以使用php进行渲染。

出于好奇,当你查看index.html时,你看到了什么?它有效?

你的意思是它没有被识别吗?您可以尝试将其添加到Web服务器根目录中的.htaccess文件中:

DirectoryIndex index.php