I use xampp to develope my WordPress sites, 3 months ago I set up a project and accessed localhost/phpmyadmin with no issues and have been working on the project since. However yesterday I tried to set up a new project and access localhost/phpmyadmin and I recieved:
403 Error page: “Access forbidden! You don’t have permission to access the requested object. It is either read-protected or not readable by the server. If you think this is a server error, please contact the webmaster.”
I haven’t updated xampp or changed anything since 3 months ago and my other wordpress project is working perfectly, no database issues.
I just can’t access localhost/phpmyadmin.
I’m using Apache/2.4.37 (Win32), PHP/7.3.0, OpenSSL/1.1.1a, XAMPP Control Panel v3.2.2
I’ve tried editing C:/xampp/apache/conf/extra/httpd-xampp.conf and replacing “require local” with both “request all garunteed” and “require all granted” inside but neither worked.
I’ve read lots of other threads but everyone’s httpd-xampp.conf file contains a LocationMatch tag, which mine does not.
Here is my httpd-xampp.conf file:
#
# XAMPP settings
#
<IfModule env_module>
SetEnv MIBDIRS "C:/xampp/php/extras/mibs"
SetEnv MYSQL_HOME "\xampp\mysql\bin"
SetEnv OPENSSL_CONF "C:/xampp/apache/bin/openssl.cnf"
SetEnv PHP_PEAR_SYSCONF_DIR "\xampp\php"
SetEnv PHPRC "\xampp\php"
SetEnv TMP "\xampp\tmp"
</IfModule>
#
# PHP-Module setup
#
LoadFile "C:/xampp/php/php7ts.dll"
LoadFile "C:/xampp/php/libpq.dll"
LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"
<FilesMatch ".php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch ".phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
#
# PHP-CGI setup
#
#<FilesMatch ".php$">
# SetHandler application/x-httpd-php-cgi
#</FilesMatch>
#<IfModule actions_module>
# Action application/x-httpd-php-cgi "/php-cgi/php-cgi.exe"
#</IfModule>
<IfModule php7_module>
PHPINIDir "C:/xampp/php"
</IfModule>
<IfModule mime_module>
AddType text/html .php .phps
</IfModule>
ScriptAlias /php-cgi/ "C:/xampp/php/"
<Directory "C:/xampp/php">
AllowOverride None
Options None
Require all denied
<Files "php-cgi.exe">
Require all granted
</Files>
</Directory>
<Directory "C:/xampp/cgi-bin">
<FilesMatch ".php$">
SetHandler cgi-script
</FilesMatch>
<FilesMatch ".phps$">
SetHandler None
</FilesMatch>
</Directory>
<Directory "C:/xampp/htdocs/xampp">
<IfModule php7_module>
<Files "status.php">
php_admin_flag safe_mode off
</Files>
</IfModule>
AllowOverride AuthConfig
</Directory>
<IfModule alias_module>
Alias /licenses "C:/xampp/licenses/"
<Directory "C:/xampp/licenses">
Options +Indexes
<IfModule autoindex_color_module>
DirectoryIndexTextColor "#000000"
DirectoryIndexBGColor "#f8e8a0"
DirectoryIndexLinkColor "#bb3902"
DirectoryIndexVLinkColor "#bb3902"
DirectoryIndexALinkColor "#bb3902"
</IfModule>
Require local
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>
Alias /phpmyadmin "C:/xampp/phpMyAdmin/"
<Directory "C:/xampp/phpMyAdmin">
AllowOverride AuthConfig
Require local
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>
Alias /webalizer "C:/xampp/webalizer/"
<Directory "C:/xampp/webalizer">
<IfModule php7_module>
<Files "webalizer.php">
php_admin_flag safe_mode off
</Files>
</IfModule>
AllowOverride AuthConfig
Require local
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>
</IfModule>
2
Answers
I found the solution and it had nothing to do with my configurations. For some reason my phpmyadmin folder had been moved out of C:/xampp into C:/Data. No idea how, possibly Windows update? Anyway, I found this by going to the XAMPP Control Panel > Apache > Config > phpMyAdmin and when I clicked on it; it said it could not find the file in C:/xampp/phpmyadmin. I then searched my computer for phpmyadmin and found it in C:/Data. Cut and pasted it into C:/xampp and voila! Everything works perfectly. image of xampp control panel showing steps
You might try checking permissions on “C:/xampp/phpMyAdmin/”. Maybe you accidentally changed them / owner.
Good luck.