OK guys, this worked: I got the auth window opening up and logged in, but then got Internal Server Error. So I used the absolute path, solved. BUT, for the record, this is awful! I can't put this file in a git repo anymore because I can't use relative paths. Thanks Obama, thanks Trump! (relax, a little political humor :)
– Oliver WilliamsJul 8 '17 at 18:33

1

The internal server error problem solved using that echo function and setting path to the file. It works!
– Jakub MudaMar 16 '18 at 21:09

I would also add that some on some Web hosts, the .htpasswd file will not work if placed in a publicly accessible area. A recent installation I did confirmed this. As others have noted, it's best to place this in the root of the site.

"...best to place this in the root of the site" - Your last sentence appears to contradict your first (assuming by "root" you mean the document root)? As you suggest, this file should ideally be outside of the publicly accessible area. eg. above the document root.
– MrWhiteNov 7 '16 at 11:24