Hi,
I have the following problem with my .htpasswd.
when I use the htpasswd program it works fine. I can protect my directory.
when I use php and the following code to create the .htpasswd I have an authentication failure. I guess the .htpasswd hasn't been created fine.
code:
------
$log="toto";
$pass="toto42";
$htpasswd_txt .= "$log:".crypt($pass,CRYPT_STD_DES)."\n";
$htpasswd = fopen(".htpasswd", "w");
$r = fputs($htpasswd, $htpasswd_txt);
fclose($htpasswd);
so when I have the popup for login/passwd I put toto and toto42 and I cannot access the directory.
And the log told me that it is an authentication failure:
user toto: authentication failure for "/path/to/the/file/index.htm": password mismatch
Is someone know why?
.htpasswd problem
Moderator: General Moderators
.htaccess:
------------
AuthUserFile "/var/www/vhost1/https/.htpasswd"
AuthName UserAuthentication
AuthType Basic
require valid-user
its path is: "/var/www/vhost1/http/galleries/rep1/.htpasswd"
and of course my .htpasswd is in :"/var/www/vhost1/https/"
the thing I don't understand is why with "htpasswd" it works and just after I use my function to create the .htpasswd and it doesn't work?
let me know if you need more information
------------
AuthUserFile "/var/www/vhost1/https/.htpasswd"
AuthName UserAuthentication
AuthType Basic
require valid-user
its path is: "/var/www/vhost1/http/galleries/rep1/.htpasswd"
and of course my .htpasswd is in :"/var/www/vhost1/https/"
the thing I don't understand is why with "htpasswd" it works and just after I use my function to create the .htpasswd and it doesn't work?
let me know if you need more information
Sorry 
for the example I took toto/toto42 as login/pass.
With htpasswd function the .htaccess looks like:
toto:2qm.tGvVQqiJY
when I use the my php function which is:
$log="toto";
$pass="toto42";
$htpasswd_txt .= "$log:".crypt($pass,CRYPT_STD_DES)."\n";
$htpasswd = fopen(".htpasswd", "a");
$r = fputs($htpasswd, $htpasswd_txt);
fclose($htpasswd);
the .htaccess looks like:
toto:1$5AVXvgnuw2.
Obviously they are different because they don't use the same seed to crypt.
Do you have any idea?
for the example I took toto/toto42 as login/pass.
With htpasswd function the .htaccess looks like:
toto:2qm.tGvVQqiJY
when I use the my php function which is:
$log="toto";
$pass="toto42";
$htpasswd_txt .= "$log:".crypt($pass,CRYPT_STD_DES)."\n";
$htpasswd = fopen(".htpasswd", "a");
$r = fputs($htpasswd, $htpasswd_txt);
fclose($htpasswd);
the .htaccess looks like:
toto:1$5AVXvgnuw2.
Obviously they are different because they don't use the same seed to crypt.
Do you have any idea?
I have only 1 thing to say:
@#$$%$#@%$#@ Windows.
because it works now. I restarted my computer and it works.
I really don't understand because every time I try with each of them (htpasswd and my function) I took all the precaution like closing the IE and reopen a new one.
And now it works.
I am really sorry if you wasted some times.
windows ?ucksssssssssss
@#$$%$#@%$#@ Windows.
because it works now. I restarted my computer and it works.
I really don't understand because every time I try with each of them (htpasswd and my function) I took all the precaution like closing the IE and reopen a new one.
And now it works.
I am really sorry if you wasted some times.
windows ?ucksssssssssss