0

Invalid command 'Auth_MYSQLhost', perhaps misspelled or defined by a module not included in the server configuration

I'm following this guide for configuring .htaccess for MySQL login. I'm running Apache but I get the error above. This is the code:

AuthType Basic
AuthName "MySQL Member Page"

Auth_MYSQLhost localhost
Auth_MYSQLusername root
Auth_MYSQLpassword root
Auth_MYSQLdatabase login
Auth_MYSQLpwd_table administrators
Auth_MYSQLuid_field username
Auth_MYSQLpwd_field password
Auth_MYSQL_EncryptedPasswords off
require valid-user

It doesn't even try to connect to mysql but fail as soon as it reads Auth_MYSQLhost. Why is this? I've already tried with AuthMYSQLhost, authMYSQLhost, auth_MYSQLhost with no luck.

4

1 回答 1

1

您可能需要安装 auth_mysql Apache 模块。如果您在终端上运行 Debian/Ubuntu,请执行以下操作:

 sudo apt-get install libapache2-mod-auth-mysql

然后激活模块:

 sudo a2enmod auth_mysql

并重新启动 Apache:

sudo service apache2 restart

现在它可以工作了。

于 2014-04-06T17:54:03.927 回答