我已经在 Ubuntu 12.04 上安装了 xampp。我已将我的项目放在文件夹/opt/lampp/htdocs/project_is_here 中
当我在浏览器中键入 localhost/soap/php
(soap/php 在我的 htdocs 文件夹中)时,index.php
出现以下错误:
Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
Apache/2.4.3 (Unix) OpenSSL/1.0.1c PHP/5.4.7
有什么解决办法吗?我认为这是放置项目的正确位置,因为我尝试了其他地方,它说位置不存在,这个错误在这里消失了,我明白了。
有什么想法吗?
最佳答案
在 linux 终端中导航到您的 lampp 目录。
cd /opt/lampp
在命令行输入:
sudo chmod 777 -R htdocs
问题应该解决了。
你刚刚做的是:
导航到包含 protected 目录的目录。您的问题是它是一个受系统访问保护的文件夹。当您命令 chmod 777 -R htdocs 时,您将计算机上每个用户的权限设置为“读/写/执行 - 允许”。
0-7 之间的每个数字设置一个权限级别。这是一个更详细地解释这一点的链接。
http://www.pageresource.com/cgirec/chmod.htm
'-R' 使命令递归,并将影响 htdocs 以及 htdocs 的所有子目录以及这些子目录的所有子目录等。
关于php - Xampp - Ubuntu - 无法在 lampp/htdocs 中访问我的项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17624936/