[Solved] Access forbidden! New XAMPP security concept. Error 403

After fresh installation of XAMMP (LAMPP) you get this 403 error when accessing phpMyAdmin using browser.

phpmyadmin xampp 403 forbidden

It is due to new security rule according to which access to the requested directory is only available from the local network. So here are the step-by-step solution:

Note: (All file location are under assumption that lampp installation directory exists under opt directory, if you have lampp installed elsewhere, change it according wise)

1. Open the httpd-xampp.conf file at the location /opt/lampp/etc/extra/httpd-xampp.conf using a text editor (nano here) after going root in the terminal:

open httpd conf xampp

2. Search for the text #New XAMPP security concept and beneath that find the line Deny from all. 

deny from all

3. Replace the word Deny with Allow so that it becomes Allow from all :

Allow from all

4. Now search the text <Directory “/opt/lampp/phpmyadmin> and between this opening tag line and its closing tag line </Directory>, add the line Require all granted and save(overwrite) the file.

require all grantedTo save the file in nano text editor use command: Ctrl+O followed by Enter. Give command Ctrl+X to exit from the text editor and come back to the terminal.

5. Now restart the XAMPP (LAMPP) using this command:

/opt/lampp/lampp restart

restart xampp lampp

6. Now point your browser to http://localhost/phpmyadmin and test whether you did it right or not. (Yes we did it right! :-) )

phpMyAdmin

15 Responses to [Solved] Access forbidden! New XAMPP security concept. Error 403

  1. Dr.K.Suresh on March 11, 2014 at 3:08 PM

    This answer applicable to XAMPP 1.8.2[PHP: 5.4.25]

    Just put # mark before below, And importantly, stop and start Apache in xampp control panel.That’s it, it definitely work

    #
    # New XAMPP security concept
    #

    #Require local
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var

  2. Dr.K.Suresh on March 11, 2014 at 3:10 PM

    This answer applicable to XAMPP 1.8.2[PHP: 5.4.25]

    Just put # mark before “”"Require local”"” below, And importantly, stop and start Apache in xampp control panel.That’s it, it definitely work

    #
    # New XAMPP security concept
    #
    LocationMatch “^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))”
    #Require local
    ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
    LocationMatch

  3. Wasik Ovee on March 23, 2014 at 11:16 PM

    Yes we did it right! :-)

  4. shahbaz on March 28, 2014 at 11:10 AM

    Access forbidden!

    You don’t have permission to access the requested object. It is either read-protected or not readable by the server.

    If you think this is a server error, please contact the webmaster.

    Error 403

    localhost
    03/28/14 10:56:58
    Apache/2.2.8 (Win32) DAV/2 mod_ssl/2.2.8 OpenSSL/0.9.8g mod_autoindex_color PHP/5.2.5

    how to solve this error

  5. Tugvarish on March 28, 2014 at 7:12 PM

    Very insecure way to do it!
    Here is the correct way: https://community.apachefriends.org/f/viewtopic.php?f=17&t=50902&p=196185#p202339

  6. Alf on April 26, 2014 at 5:54 PM

    Perfect for openbox in Manjaro

  7. Viktor on May 1, 2014 at 2:20 PM

    Thanks for sharing this!

  8. Thanks on May 2, 2014 at 11:59 AM

    Thanks man, it worked. I had a similar problem and your work helped me fix it real quick.

    Keep on rocking. :)

  9. Rashedul Islam on May 3, 2014 at 8:18 PM

    This works well..thanks :)

  10. kangzin on May 17, 2014 at 7:58 AM

    Worked well, thanks :D

  11. Ali Bsharat on May 27, 2014 at 2:04 PM

    thank you very much
    but when i save the nano editor
    drop this proplem
    Error writing /opt/lampp/etc/extra/httpd-xampp.conf: Permission denied
    what should i do ?

    • Amit Thakur on June 3, 2014 at 6:09 PM

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

      Add the “sudo” at the start of the command and give the password.

  12. Paul on June 13, 2014 at 11:51 AM

    Spent a half day searching for a solution, and all it took was a simple “#”.

    For security concerns, removed # when I was done.

    For those interested, most of I solutions found i.e. to add “Require all granted” in /opt/lampp/etc/extra/httpd-xampp.conf does not work, and its in there by default, at least in the version I was editing.

    • Paul on August 20, 2014 at 10:15 AM

      Sorry, forgot to mention what I commented out in the file.

      Inserted a # in front of the line “Require local” (located towards the end of the file).

      Don’t forget to stop xampp before modifying httpd-xampp.conf and then restart xampp.

      Also don’t forget to stop xampp, uncomment line, start xampp when you have finished the actions you wanted to perform in phpMyadmin.

  13. kiplangat peter on June 25, 2014 at 6:41 PM

    ‘Connection for controluser as defined in your configuration failed’ this is what showed up after opening phpmyadmin.

Leave a Reply

Your email address will not be published. Required fields are marked *