germainelol germainelol - 1 year ago 151
PHP Question

Xampp - Ubuntu - cant access my project in lampp/htdocs

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

When I type in the browser

(soap/php is in my htdocs folder) which is where
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

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.

Any ideas?

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

    cd /opt/lampp
  2. In the command line type:

    sudo chmod 777 -R htdocs

The problem should be solved.

1st Edit:

Now, I do not like to be the guy who waves the magic wand and says there you go; therefore, I am going to explain what you just did.

You navigated 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, what you did was set the permissions for everyone on your computer to read/write/execute - allowed.

What is this 777 ? --> 7: you, 7: us, 7: them.

If you wrote chmod 700 then you (probably root, actually) would have all permissions, and then we (the "user group" in your system) would have no permissions, and everyone else, being the last 0 of the 700 would have none either. To deny everyone permissions it would be chmod 000. Clear? Now, you know what each digit means. It says who the number is about. Now each number from 0-7 sets a permission level. I will simply provide you a link for that.

I hope this helps.

2nd Edit:

I forgot to add why there is a -R. -R means the command is recursive and will affect htdocs as well as all subdirectories of htdocs and subdirectories of the subdirectories of htdocs.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download