4

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?

Shimanto
  • 283
  • 5
  • 11
  • look at https://support.apple.com/guide/terminal/make-a-file-executable-apdd100908f-06b3-4e63-8a87-32e71241bab4/mac I think problem on owner of files – Pavlo Mezhevikin Feb 10 '22 at 10:10

2 Answers2

1

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

1

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)