Is it possible to block access to phpmyadmin page over the network in XAMMP Windows? I want only localhost( to be able to access the page. Other people connected to the same network shouldn't be able to access it. Eg. if tries to access they couldn't access it.

2 Answers 2


If I was running phpmyadmin and wanted to restrict access to localhost, I would use the Apache web server and would use the Order, Deny, and Allow directives to govern access. For example:

<Directory "/my/restricted/content" >
Order Deny,Allow
Deny from All
Allow from

If you don't use Apache but your web server has something similar to Apache's mod_authz_host you should be able to set up a similar access restriction.

  • I'm using apache as my web server. Sorry a dumb question, but is that a .htcaccess file? If so, where do i put it? Or I should edit some configuration file or something?
    – ysj
    May 8, 2013 at 6:49
  • @ysj - put it into one of the configuration files; generally it is advisable to read the docs before going into web development. May 8, 2013 at 7:03

In addition to having your webserver block acccess to the right URL you should also: 1 Not use /phpmyadmin is the path 2 Not install phpmyadmin on the default listening ports (80, 443) 3 Configure the hosts firewall to block external access to the port you use 4 Consider not leaving phpmyadmin active all the time; it takes almost no time to spin up an httpd so leave it off and light it up when you need to use it, and take it down when you're done.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.