【发布时间】:2023-04-08 00:57:01
【问题描述】:
我在 ubuntu 上使用 apache2。我的本地主机工作正常,php 也正常工作。
但只有文件名 index.php 不起作用。如果文件名是 test.php 或 index.php 以外的任何其他名称,它可以工作。
不知道是apache prob还是php,谁能帮忙?
谢谢, 卡米尔
【问题讨论】:
标签: php apache ubuntu apache2 ubuntu-12.04
我在 ubuntu 上使用 apache2。我的本地主机工作正常,php 也正常工作。
但只有文件名 index.php 不起作用。如果文件名是 test.php 或 index.php 以外的任何其他名称,它可以工作。
不知道是apache prob还是php,谁能帮忙?
谢谢, 卡米尔
【问题讨论】:
标签: php apache ubuntu apache2 ubuntu-12.04
避免使用 htaccess 文件并编辑 http.conf。它也应该是相同的列表 DirectoryIndex 那里。添加 index.php 看看能不能得到 php 来渲染。
出于好奇,您在查看 index.html 时看到了什么?有用! ?
【讨论】:
你的意思是它不被识别?您可以尝试将其添加到您的网络服务器根目录中的 .htaccess 文件中:
DirectoryIndex index.php
【讨论】: