Receiving ‘phpMyAdmin 403 forbidden error’? We can help you fix it.
This error message is normally caused due to improper PHP installation or due to configuration file trouble.
At Bobcares, we receive requests to fix the phpMyAdmin errors as a part of our Server Management Services.
Today, let’s see the causes and how our Support Engineers fix this error.
Why phpMyAdmin 403 forbidden error occurs?
Many of our customers install the phpMyAdmin in their Linux server(CentOS/RHEL/Debian). And sometimes, when they try to access the phpMyAdmin they land up with 403 forbidden errors.
The forbidden error means one doesn’t have the permission to access /phpMyAdmin/ on the server.
This error often occurs if customers install phpMyAdmin using or by apt-get. The default path of phpMyAdmin is /usr/share/phpmyadmin.
And etc/httpd/conf.d/phpmyadmin.conf is the apache configuration file path.
Also, there are many different reasons for this error to occur. This mainly includes an error in the PHP installation, adding any deny code in the configuration file and so on.
Here, is a screenshot of how the error message appears while accessing the phpMyAdmin.
How we fix phpMyAdmin 403 forbidden error?
Till now we’ve discussed the error message and its causes. Now, let’s see how our Support Engineers fix this error message to our customers.
Recently, one of our customers approached us with an error message:
Forbidden
You don't have permission to access /phpMyAdmin/ on this server.
So our Support Engineers checked the configuration file of phpMyAdmin i.e. /etc/httpd/conf.d/phpmyadmin.conf which has the below lines:
<Directory /usr/share/phpMyAdmin/>
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1
</Directory>
<Directory /usr/share/phpMyAdmin/setup/>
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1
</Directory>
The deny code in the above lines were causing trouble. So we removed those contents and re-updated the file as below
<Directory /usr/share/phpMyAdmin/>
Allow from xx.x.x.x
Allow from ::1
</Directory>
<Directory /usr/share/phpMyAdmin/setup/>
Allow from xx.x.x.x
Allow from ::1
</Directory>
Then, we used the below command to restart Apache
systemctl restart httpd
Finally, this fixed the error.
[Need assistance in fixing phpMyAdmin errors? – We’ll help you]
Conclusion
In short, the 403 forbidden error in phpMyAdmin mainly occurs due to either PHP installation error or due to some error in the configuration file. Today, we saw how our Support Engineers fix this error.
I think it would have been better to keep the deny. I have mine set up the same way, but my fix was to add my own ip address (that i will be accessing phpmyadmin from) after the Allow from line, like so:
Order Deny,Allow
Deny from All
Allow from 127.0.0.1 xx.xx.xx.xx
coolabove code where i have to paste ???
You need to update the code in the configuration file : /etc/httpd/conf.d/phpmyadmin.conf