If you’re using the XAMPP local development environment to run a WordPress website, you may run into issues from time to time. One of the most common problems you might encounter while trying to access your database is “error 403”, also known as the “XAMPP access forbidden error”.
In a nutshell, XAMPP error 403 means you don’t have the necessary permissions to access or edit the database. In this article, we’ll talk about what XAMPP is, why this error shows up, and how to fix it on both Windows and macOS devices. Let’s get to it!
An Introduction to XAMPP
XAMPP is a local development environment. By installing XAMPP, you’re also setting up all the software you need to host and run local WordPress websites.
As you might know, WordPress has several system requirements, and XAMPP meets all of them. The software stack that you can install on your computer using XAMPP includes:
- Apache: This the server software that enables you to host and serve websites on your computer.
- MariaDB: This is the database software that provides WordPress somewhere to save information, so it can be accessed again as needed.
- PHP: WordPress is built on top of the PHP programming language, so it’s essential to set up the software on your server.
- Perl: Although WordPress doesn’t use the Perl programming language, it comes as part of the software stack that XAMPP configures for you.
You’ve probably run into an error 403 at some point while browsing the web. The error code means that you don’t have the necessary permissions to access a specific file or page:
However, in the context of using XAMPP to run a local WordPress website, error 403 has a different meaning. If you see a message that says “Access forbidden!“, it usually has to do with the XAMPP database.
An Overview of XAMPP Error 403
Typically, XAMPP error 403 appears when you try to access your local database through the browser. In normal circumstances, you can do that by going to the http://localhost/phpmyadmin address using any web browser:
If you don’t have the necessary permissions to access the database, you’ll run into error 403, which reads:
“New XAMPP security concept: Access to the requested directory is only available from the local network. This setting can be configured in the file httpd-xampp.conf.”
As far as error messages go, this one is fairly informative, as it tells you precisely what you need to do to solve the problem. However, before we start troubleshooting, it’s important to note that error 403 usually occurs when there are conflicting port configurations within XAMPP.
Often, the easiest way to bypass the issue is to do as the error message says. In this case, that’s to modify the httpd-xampp.conf file.
How to Troubleshoot XAMPP Error 403 (in Windows and macOS)
XAMPP is available for Windows, macOS, and Linux. In the sections below, we’ll show you how to troubleshoot XAMPP error 403 in both Windows and macOS. If you’re using a Linux distribution, you can follow the macOS instructions.
How to Troubleshoot XAMPP Error 403 in Windows
To get started, go ahead and launch XAMPP, and then start all of the services that your website uses. If you’re running a WordPress website, that would be Apache and MySQL.
Once both services are running, you can click on the Config button along the Apache row, and then select the Apache (httpd-xampp.conf) option:
Now the httpd-xampp.conf file will open via your default text editor. With the file open, use the search feature to look for “phpMyAdmin”. You should see a snippet that looks like this:
Once you’ve located it, you can go ahead and delete the text that says “Require local” and replace it with “Require all granted”:
Save the changes to httpd-xampp.conf and close the file. Then you can restart both the Apache and MySQL services from the XAMPP control panel. Once the services are running again, you can try accessing your database once more by navigating to localhost/phpmyadmin in your browser.
How to Troubleshoot XAMPP Error 403 in macOS
Fixing XAMPP error 403 on macOS involves almost the same steps as it does for Windows devices. However, accessing the httpd-xampp.conf file is not precisely the same, since the XAMPP control panel looks a bit different:
Despite the difference in style, accessing the file you need is still simple. Here are the five steps to follow:
- Go to the Volumes tab in the XAMPP control panel.
- Select the Mount option at the top of the screen.
- Click on the Explore button next to Mount once it becomes selectable.
- In the explorer window that pops up, navigate to etc/extra.
- Open the http-xampp.conf file.
Once the file is open, you can look for “phpmyadmin”within it. The snippet you see should look like this:
Alias /phpmyadmin "C:/xampp/phpMyAdmin/" <Directory "C:/xampp/phpMyAdmin"> AllowOverride AuthConfig Require local ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var </Directory>
Next, you can replace the part that says “Require local” with “Require all granted”, and save the changes to the file. Now return to the XAMPP control panel, go to the “Services” tab, and click on Restart All. After all the XAMPP services are backed up, you should be able to access your database without problems.
Being able to access your website’s database is critical, whether you’re using a live server or a local development environment such as XAMPP. Although XAMPP error 403 can be annoying, it’s easy to solve whether you’re using Windows, macOS, or Linux.
All you have to do is edit the XAMPP httpd-xampp.conf file to ensure that everyone has access to phpMyAdmin. Then the 403 error should disappear right away.
If you want access to a local WordPress development environment that is easy to use and troubleshoot, we recommend giving DevKinsta a try. DevKinsta is available for free whether you’re a Kinsta user or not, and you can use it to set up many local WordPress websites as you need!
Save time, costs and maximize site performance with:
- Instant help from WordPress hosting experts, 24/7.
- Cloudflare Enterprise integration.
- Global audience reach with 34 data centers worldwide.
- Optimization with our built-in Application Performance Monitoring.