Resolving phpMyAdmin Access Denied Error (403 Forbidden) on CentOS

When accessing phpMyAdmin from a browser on a CentOS machine, you may encounter the following error:

Forbidden

You don't have permission to access /phpmyadmin on this server.

This usually happens due to IP-based restrictions configured in the Apache configuration for phpMyAdmin. Follow the steps below to resolve the issue and allow access from your workstation.

Steps to Allow Access to phpMyAdmin from a Remote Workstation

Locate the phpMyAdmin Configuration File

Typically located at:

/etc/httpd/conf.d/phpMyAdmin.conf

Open the file in a text editor:

nano /etc/httpd/conf.d/phpMyAdmin.conf

Update IP Address Restrictions

Look for the following lines in the configuration:

Require ip 127.0.0.1

Replace with your workstation's IP address. For example:

Require ip 10.1.3.53

Similarly, find:

Allow from 127.0.0.1

Replace with:

Allow from 10.1.3.53

Comment Out Access Denials

Search for lines like:

Deny from all

Comment them out by adding a # at the beginning:

# Deny from all

Do this for all instances in the file to prevent unintended blocking.

Save and Exit

Save your changes and close the editor.

Restart Apache HTTP Server

Apply the changes by restarting Apache:

service httpd restart

Conclusion

By updating the IP address directives and commenting out restrictive rules, you've enabled access to phpMyAdmin from your workstation. Always ensure that only trusted IPs are allowed to maintain server security.


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS