Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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 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.

Any ideas?

like image 565
germainelol Avatar asked Jul 12 '13 22:07

germainelol


People also ask

How can I access XAMPP htdocs folder in Ubuntu?

The htdocs folder can be found in /opt/lampp/ . You can navigate to your root folder from the file manager (nautilus by default), by clicking on Other locations from the sidebar, then Computer . From there you can find the opt folder that contains the lampp folder. code .

How do I access XAMPP htdocs?

Open the XAMPP directory through the 'Explorer' button in the Control Panel and choose the folder htdocs (C:\xampp\htdocs for standard installations). This directory will store file data collected for web pages that you test on your XAMPP server.

How do I give permission to a folder in XAMPP?

You can set permissions for the XAMPP folder by right clicking on it and click on Get Info. From there expand Sharing and Permissions at the bottom if it already isn't. Depending on where the folder is you may need to click the lock icon at the bottom right to allow you to make changes.


2 Answers

  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.

What you just did was:

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".

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

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

like image 60
Ryan Mortensen Avatar answered Sep 24 '22 15:09

Ryan Mortensen


i've experinced the same problem and this is my solution :


1.in the terminal

cd /opt/lampp/etc/ 
  1. if you have sublime text installed simply just type :

subl httpd.conf

3.when the configuration file opened in sublime you have to check if these three blocks are as follow :

<Directory />     AllowOverride All     Require all granted </Directory> 

================================

<Directory "/opt/lampp/htdocs">  Options Indexes FollowSymLinks ExecCGI Includes  AllowOverride All  Require all granted </Directory> 

================================

User your username Group your group name 

for example :

my username is mhmd also my group name is mhmd

User mhmd Group mhmd 

and i hope it will help you ..

like image 44
Mohammad Salem Avatar answered Sep 22 '22 15:09

Mohammad Salem