skip to Main Content

I tried to install phpMyadmin in MacOs. But When I go to localhost/phpmyadmin it says Forbidden You don't have permission to access this resource. My phpMyAdmin folder is in
/usr/local folder in Finder. I configured the phpmyadmin.conf file with sudo nano /etc/apache2/other/phpmyadmin.conf with the following codes:

<Directory /usr/local/phpmyadmin>
        Options Indexes
        Order allow,deny
        Allow from all
        allow from 127.0.0.1
        allow from 192.168.1.0/15
</Directory>

What should I do to get rid of this error?

2

Answers


  1. Find file httpd-xammp.conf, change ‘Require local’ to ‘Require all granted’, save file and restart apache

    Login or Signup to reply.
  2. You need to check 2 things:

    • that your phpmyadmin folder (/usr/local/share/phpmyadmin by default, but judging by your question I assume it’s /usr/local/phpmyadmin; be sure to check on that too) is readable by your user and that directories that needs to be writeable by you are.
    • that you have correct order for Allow and Deny settings for that directory (you either deny from all and then allow from certain locations, or allow from all locations and then disallow from some).

    I suggest changing the config file to look like this:

    <Directory /usr/local/phpMyAdmin/>
        Options Indexes
        Order Deny,Allow
        Deny from All
        Allow from 127.0.0.1
        Allow from 192.168.1.0/15
    </Directory>

    Make sure that the path in <Directory /usr/local/phpMyAdmin/> is pointing to your phpmyadmin location.

    Also I’m not sure there should be Options Indexes line in the config, try removing it temporarily.

    Upd: You need to restart apache after making changes to config files (usually it’s sudo service apache2 restart)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search