Linux 在 htdocs 目录外托管文件

Linux Hosting files outside the htdocs directory

我关注了 this instructions to be able to host files outside of the htdocs directory, but I alwyas get 'Access Forbidden' (https://gyazo.com/af49cb00720fa4bd80e969320bd51042)。

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

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

尝试授予文件权限。

sudo chmod +x test.php

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

sudo chown root:www-数据test.php

sudo chmod 775 test.php