【问题标题】:can not access the php file in the sub folders?无法访问子文件夹中的 php 文件?
【发布时间】:2014-09-26 06:56:21
【问题描述】:

重新安装apache ant php后,遇到一个问题,只有根目录下的php文件可以访问,根目录下的子目录下的php文件无法访问。

我正在使用 apache2.2 php4.3 和 codeigniter php 框架。

    #apache config
    <Location /gl>
    </Location>
    Alias /gl /mnt/deploy/hospital


when I put file in "http://.../gl/application/controllers/test1.php", the browser report 500 error, and I check the /var/log/apache2/error.log no php error find.

when I put file in "http://.../gl/test1.php" thing's ok.

【问题讨论】:

  • “无法访问”是什么意思?

标签: php apache codeigniter apache2


【解决方案1】:

你必须告诉 apache 谁可以访问别名。

试试

Alias /gl /mnt/deploy/hospital
<Directory "/mnt/deploy/hospital">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order Deny,Allow
    Deny from all
    Allow from localhost 127.0.0.1

</Directory>

如果您必须,并且您不是在本地测试环境中工作,请使用:-

Allow from all

而不是

Allow from localhost 127.0.0.1

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-04-07
    • 2015-03-13
    • 1970-01-01
    • 2018-05-12
    • 1970-01-01
    • 2022-01-09
    • 2013-11-04
    • 2015-07-04
    相关资源
    最近更新 更多