RE: [PHP] Automate the apache authentication process
| From: | Jason Murray | Date: | Mon, 29 Jan 2001 23:42:57 +0000 |
| Subject: | RE: [PHP] Automate the apache authentication process | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-37183@lists.php.net to get a copy of this message | ||
> However, Apache htpasswd is an interactive program and we
> need manually input the password, is there a way to automate
> and batch process this using php scripts?
[jason@phpdev htdocs]$ /usr/local/apache/bin/htpasswd --help
Usage:
htpasswd [-cmdps] passwordfile username
htpasswd -b[cmdps] passwordfile username password
-c Create a new file.
-m Force MD5 encryption of the password.
-d Force CRYPT encryption of the password (default).
-p Do not encrypt the password (plaintext).
-s Force SHA encryption of the password.
-b Use the password from the command line rather than prompting for it.
Looks like you should be able to run htpasswd as a fire-and-forget
operation, just play with the flags.
Jason