Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess .htaces和.htpasswd是否给出错误?_.htaccess_.htpasswd - Fatal编程技术网

.htaccess .htaces和.htpasswd是否给出错误?

.htaccess .htaces和.htpasswd是否给出错误?,.htaccess,.htpasswd,.htaccess,.htpasswd,嗯,我正试图用.htaccess和.htpasswd保护我的xampp,我看不出有什么错误,我认识的许多其他开发人员也是如此 我的.htaccess: AuthName "Protected Area" AuthType Basic AuthUserFile C:/xampp/secret/hidden/place/.htpasswd require valid-user php_flag register_globals on My.htpasswd: wscript:$apr1$Y107O

嗯,我正试图用.htaccess和.htpasswd保护我的xampp,我看不出有什么错误,我认识的许多其他开发人员也是如此

我的.htaccess:

AuthName "Protected Area"
AuthType Basic
AuthUserFile C:/xampp/secret/hidden/place/.htpasswd
require valid-user
php_flag register_globals on
My.htpasswd:

wscript:$apr1$Y107OG1n$Ui6D997SqhERXXyV9VBU51
错误是错误500


有人吗?

您应该查阅错误日志文件,通常位于:
/var/log/apache2/error.log
。在不知道确切错误的情况下,实际上只有猜测可能是什么问题

AuthName "Protected Area"
AuthType Basic
AuthUserFile C:/xampp/apache/var/www/site/.htpasswd
Require valid-user
  • 要求有效用户应为大写“R
  • AuthUserFile通常位于web根目录上方的一个目录中
  • 需要设置.htaccess和.htpasswd上的权限,以便Apache能够读取它们:chmod 0644.htaccess chmod 0644.htpasswd

()

检查您的Apache error.log文件,看看您遇到了什么错误。