本文介绍了Xampp - Ubuntu - 无法在 lampp/htdocs 中访问我的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将 xampp 安装到 Ubuntu 12.04.我已将我的项目放在文件夹/opt/lampp/htdocs/project_is_here

I have installed xampp to Ubuntu 12.04. I have put my project in the folder /opt/lampp/htdocs/project_is_here

当我在浏览器中输入 localhost/soap/php (soap/php 在我的 htdocs 文件夹中)这是 index.php 我收到以下错误:

When I type in the browser localhost/soap/php (soap/php is in my htdocs folder) which is where index.php I get the following error:

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

任何想法如何解决这个问题?我认为这是放置项目的正确位置,因为我尝试了其他地方,但它说该位置不存在,此错误在这里消失了,我明白了.

Any ideas how to fix this? I think this is the right location to put the project, because I tried other places and it said location didnt exist and this error goes away here and I get this.

有什么想法吗?

推荐答案

  1. 在 linux 终端中导航到您的 lampp 目录.

  1. In the linux terminal navigate to your lampp directory.

 cd /opt/lampp

  • 在命令行输入:

  • In the command line type:

     sudo chmod 777 -R htdocs
    

  • 问题应该得到解决.

    你刚刚做的是:

    导航到包含受保护目录的目录.您的问题是它是一个受系统访问保护的文件夹.当您命令 chmod 777 -R htdocs 时,您将计算机上每个用户的权限设置为读/写/执行 - 允许".

    Navigate to the directory containing the protected directory. Your problem was that it was a folder that was access protected by your system. When you commanded chmod 777 -R htdocs, you set the permissions for every user on your computer to "read/write/execute - allowed".

    从 0 到 7 的每个数字设置一个权限级别.这是一个更详细解释的链接.

    Each number from 0-7 sets a permission level. Here's a link explaining that in more detail.

    http://www.pageresource.com/cgirec/chmod.htm

    '-R' 使命令递归,并将影响 htdocs 以及 htdocs 的所有子目录和这些目录的所有子目录.

    The '-R' makes the command recursive and will affect htdocs as well as all subdirectories of htdocs and all subdirectories of those etc.

    这篇关于Xampp - Ubuntu - 无法在 lampp/htdocs 中访问我的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

    09-22 14:28