Php .htaccess错误:无效命令';AuthGroupFile';

Php .htaccess错误:无效命令';AuthGroupFile';,php,apache,.htaccess,smarty,Php,Apache,.htaccess,Smarty,在此之前,我在windows上工作,我的项目工作正常。最近我搬到了ubuntu,我正在尝试在LAMP上安装项目 我已经为此创建了主机(我直接通过localhost运行的windows),运行时出现500内部服务器错误 当我查看日志文件时,发现无效的命令“AuthGroupFile”,可能拼写错误或由服务器配置中未包含的模块定义 .htaccess文件 #php_value zend.ze1_compatibility_mode off AuthName "Restricted Area"

在此之前,我在windows上工作,我的项目工作正常。最近我搬到了ubuntu,我正在尝试在LAMP上安装项目

我已经为此创建了主机(我直接通过localhost运行的windows),运行时出现
500内部服务器错误

当我查看日志文件时,发现
无效的命令“AuthGroupFile”,可能拼写错误或由服务器配置中未包含的模块定义

.htaccess文件

  #php_value zend.ze1_compatibility_mode off
  AuthName "Restricted Area" 
  AuthType Basic 
  AuthUserFile /opt/lampp/htdocs/uniplex_mobile/.htpasswd 
  AuthGroupFile /dev/null 

  <Files manageurls.html>
  require valid-user
  </Files>
  <Files addurl.html>
  require valid-user
  </Files>
  <Files editurl.html>
  require valid-user
  </Files>

  AddType application/x-httpd-php .php .htm .html
#php#u值zend.ze1_兼容性#u模式关闭
AuthName“限制区”
AuthType Basic
AuthUserFile/opt/lampp/htdocs/uniplex\u mobile/.htpasswd
AuthGroupFile/dev/null
需要有效用户
需要有效用户
需要有效用户
AddType应用程序/x-httpd-php.php.htm.html
我的项目在smarty框架上

有人能帮忙解决这个问题吗


提前感谢

假设您使用的是Apache2.2,这意味着您缺少mod_authz_groupfile模块

您需要在服务器配置中查找包含以下内容的行:

LoadModule authz_groupfile_module modules/mod_authz_groupfile.so 
或者类似的东西,并确保它被注释掉

否则,只需省去
AuthGroupFile
指令,看起来您无论如何都不会使用它。

您可以试试这个

a2enmod authz_groupfile
副本