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

后端 未结 5 1816

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

相关标签:
5条回答
  • 2021-01-30 18:32
    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:

    What you just did was:

    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.

    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.

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

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

    0 讨论(0)
  • 2021-01-30 18:45

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

    0 讨论(0)
  • 2021-01-30 18:45

    it'll useful,

      0 -> No permission
      1 -> Execute
      2 -> Write
      3 -> write and execute(2 +1)
      4 -> Read
      5 -> Read and execute
      6 -> Read and write
      7 -> read,write and execute
      Then What about three decimal 
    
      1st-digit Owner
    
      2nd- digit Group
    
      3rd- digit Others
    
    test@test:~$ sudo chown -R test:test /var/www/html/folder
    
    test@test:~$ sudo chmod -R 666  /var/www/html/folder //-system user 
    
    test@test:~$ sudo chmod -R 777  /var/www/html/folder // -browser with full
    

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

    0 讨论(0)
  • 2021-01-30 18:52

    I had given all the permission , still got the error message. Go to -> /etc/apache2/sites-available/000-default.conf set : DocumentRoot to /opt/lampp/htdocs

    All solved for me. Change the "DocumentRoot" to whichever folder your project is.

    0 讨论(0)
  • 2021-01-30 18:53

    One possible reason is that you are using Virtual host.

    In that case, use this command in your terminal

    sudo nano /opt/lampp/etc/extra/httpd-vhosts.conf
    

    Then add this block of code at the end of the file

    <VirtualHost *:80>
        DocumentRoot "/opt/lampp/htdocs"
        ServerName localhost
        ServerAlias localhost
        ErrorLog "logs/localhost-error_log"
        CustomLog "logs/localhost-access_log" common
    </VirtualHost>
    

    Finally restart XAMPP

    sudo /opt/lampp/lampp restart
    
    0 讨论(0)
提交回复
热议问题