phpMyAdmin 身份验证方法和强制 SSL 未按预期工作

标签 php mysql apache phpmyadmin

我已经在这里进行了几次关于这个经过搜索的谷歌的问答,但我不知所措。

我已经安装了 phpMyAdmin,我想强制使用 SSL 登录。我还想使用基于 cookie 的身份验证和 HTML 登录屏幕。据我所知,一切都设置正确。例如,我使用的是 $cfg['Servers'][$i]['auth_type'] = 'cookie'; 指令,我有一个配置为 42 个字符的河豚密码。但是,当我访问我的页面时,我会像基本身份验证一样弹出用户名和密码。

此外,我还指定了 $cfg['ForceSSL'] = true; 指令。但是,当我访问该页面时,我没有被重定向到该页面的 https:// 版本。

有什么想法吗?我在我的 Apache httpd.config 中设置了 AllowOverride All。我还启用了重写和 SSL 模块。

如果有帮助,下面是我的clean conf.inc.php 文件。

<?php
/*
 * Generated configuration file
 * Generated by: phpMyAdmin 3.5.7 setup script
 * Date: Sat, 30 Mar 2013 04:36:10 +0000
 */

/* Servers configuration */
$i = 0;

/* Server: My Database [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = 'My Database';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['ssl'] = true;
$cfg['Servers'][$i]['connect_type'] = 'socket';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['compress'] = true;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = '';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['CountTables'] = true;
$cfg['Servers'][$i]['tracking_version_auto_create'] = true;

/* End of servers configuration */

$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
$cfg['blowfish_secret'] = 'mysuperawesomesecret';
$cfg['ForceSSL'] = true;
$cfg['UserprefsDeveloperTab'] = true;
$cfg['ShowPhpInfo'] = true;
$cfg['LeftDisplayServers'] = true;
$cfg['DisplayServersList'] = true;
$cfg['SQLValidator']['use'] = true;
$cfg['SQLQuery']['Validate'] = true;
$cfg['QueryHistoryDB'] = true;
$cfg['RetainQueryBox'] = true;
$cfg['DefaultLang'] = 'en';
$cfg['ServerDefault'] = 1;
?>

最佳答案

好的。我想到了。正如我所怀疑的那样,这是一件愚蠢的事情。

我使用了 EPEL 中的以下包:phpMyAdmin.noarch 3.5.7-1.el6 @epel

事实证明,这个包在我不知道的位置放置了一个文件,即 /etc/phpMyAdmin/config.inc.php。该文件覆盖了我在 phpMyAdmin 根文件夹中指定的每个指令。

我正在使用 centOS 6.2。希望这个答案可以帮助将来的人:-)

关于phpMyAdmin 身份验证方法和强制 SSL 未按预期工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15715674/

相关文章:

php - php中的gettype和未知类型

php - 为什么我会收到 HY093 错误 [PDO]

mysql - 左连接 : is there a way to reduce the line numbers?

apache - 用于 Apache 2.4.2 HTTP 服务器的 SVN 模块

apache - 在 url 中使用括号创建 htaccess 规则

php - 仅在一台服务器上连接列的异常

php - foreach 循环中的 MySQL 查询

javascript - 如何判断表单是通过 Select onChange 提交还是通过 Submit 按钮提交

php - 如何无误地删除所有 Woocommerce 结账账单字段

mysql - 根据用户表中的积分对用户进行排名