【问题标题】:Linux Hosting files outside the htdocs directory在 htdocs 目录之外的 Linux 托管文件
【发布时间】:2017-09-05 19:38:18
【问题描述】:

我按照this 的说明在 htdocs 目录之外托管文件,但我总是得到“禁止访问”(https://gyazo.com/af49cb00720fa4bd80e969320bd51042)。

文件那些权限:$ ls -l ~/Documents/code/xampp/ total 4 -rw-r--r-- 1 julian users 3337 Apr 10 2017 test.php 我该如何解决这个问题?

【问题讨论】:

    标签: linux directory xampp lamp lampp


    【解决方案1】:

    Aache 无法执行 php 文件,因为 apache 没有执行 test.php 文件的权限。

    尝试授予文件权限。

    sudo chmod +x test.php

    任何用户都可以执行该文件。因此将文件组更改为 www-data 并授予可执行权限。

    sudo chown root:www-data test.php

    sudo chmod 775 test.php

    【讨论】:

      猜你喜欢
      • 2011-02-27
      • 2014-10-30
      • 2013-01-12
      • 2016-02-13
      • 2020-12-29
      • 2015-12-16
      • 1970-01-01
      • 2018-05-01
      • 2013-06-13
      相关资源
      最近更新 更多