gpt4 book ai didi

php - index.php 默认不加载

转载 作者:IT老高 更新时间:2023-10-28 11:50:14 31 4
gpt4 key购买 nike

我刚刚安装了 CentOS、Apache 和 PHP。当我访问我的网站时 http://example.com/myapp/ ,它说“禁止”。默认情况下它不会加载 index.php 文件。

当我访问 http://example.com/myapp/index.php 时,它工作正常。

知道如何解决这个问题吗?

最佳答案

Apache 需要配置为将 index.php 识别为索引文件。

实现这一点的最简单方法..

  1. 在您的网络根目录中创建一个 .htaccess 文件。

  2. 添加行...

DirectoryIndex index.php

这是有关此事的资源...
http://www.twsc.biz/twsc_hosting_htaccess.php

编辑:我假设 apache 配置为允许 .htaccess 文件。如果不是,则必须修改 apache 的配置文件 (httpd.conf) 中的设置

关于php - index.php 默认不加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2384423/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com