I am using a webhotel which offers a very simple Linux + PHP setup, and does not allow many administration privileges; however, it seems that the server PHP setup there allows for running shell programs via shell_exec.

So what I'm looking for, is a simple PHP-based tool, which:

  • Accepts a path for a .htpasswd file
  • Shows an HTML form that allows for:
    • Adding a user with a password in the .htpasswd file
    • Changing the password of an existing user in the .htpasswd file
    • Deleting a user from the .htpasswd file
  • These operations are done either through a PHP class, or by shell_exec'ing Linux commands (although PHP class is preferred, because I might not have permissions to run htpasswd and similar commands)
  • Does not offer to change any .htaccess files (I prefer to write those manually)
  • Preferably, comes in a single .php file (both the PHP code logic, and the HTML form, excluding libraries) - which I can put in a directory of choice, and then it handles the access to only that directory and below (i.e. if I want to manage a different directory, I'd have to copy the .php manager file there)

Basically, I guess it would look something like "Manage Users" of DirectoryPass:


... and AFAIK, there is a similar HTML form-based GUI in cPanel and such; but DirectoryPass is not for me because:

  • It is written in Perl, and needs to run from cgi-bin
  • In principle, it manages the whole filesystem, instead of just directory it is in (and below)
  • Offers to write .htaccess files, which I don't want

Some other "almost there" stuff I found:

There are also some suggestions on http://www.debianhelp.co.uk/htaccessweb.htm - but most of those refer to websites that do not exist anymore...

So is there anything out there, that would fit the requirements I've listed in this question/post?


1 Answer 1


This may be an option https://github.com/rafaelgou/php-apache2-basic-auth-manager. Don't have any experience with it, and not sure it has a super user... Is written entirely in PHP and Javascript, using YAML in preference to JSON files. The install instructions are located in the readme.

Best of luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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