Jump to content

.htpasswd cannot create file


Syscribe

Recommended Posts

Using Apache 2.2.3 under Windows XP Pro

 

I'm trying to use .htpasswd to create a password file, but whatever filename I try to use, I get an error message that .htpasswd cannot create the file.  If I manually create an empty file first and leave out the -c the error message changes to cannot modify the file.

 

I would prefer to use a filename which relates to the particular site I'm setting up rather than .htpasswd to avoid the overhead of using groups - ie each site will have its own dedicated password file.  From the online documentation, it looks like this should be possible but I'm beginning to doubt that I should take anything as read!

 

Hope someone can help please

 

 

Link to comment
https://forums.phpfreaks.com/topic/59672-htpasswd-cannot-create-file/
Share on other sites

Go:

htpasswd -bn username pass

 

That will give you a string like:

username:KDE0RX5e08e/E

 

Just put that in a file called any name you like. Typically .htpasswd is used as apache will not allow direct access to these files. (so someone cant browse and read your password).

 

-steve

Thanks for the advice stevie.

 

In fact I've already bypassed the problem by downloading and using htpasswd Generator (www.htpasswdgenerator.com) which doesn't seem to have a problem creating the file and allows simultaneous viewing and editing of .htpasswd, .htgroup and .htaccess to ensure they're in agreement with each other.

 

However, I'm still intrigued as to why the command line .htpasswd can't create the file.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.