我刚刚在我的本地主机(LAMP)上安装了Magento(1.7.0.2)
。现在安装后,当我想要进入管理面板时,它向我询问用户名和密码。虽然我用正确的用户名和密码仍然显示Invalid User Name or Password
。我明确了我的浏览器cookie,但它又向我展示了与登录相同的问题。我搜索了谷歌,并得到了一些我可以登录使用http://127.0.0.1
而不是http://localhost
。但它仍然不适合我。我已经搜索了谷歌一整天,并作为一些博客告诉,只是在varien.php文件中做一些行注释,我也在varien.php文件中发表评论,但仍然不工作(我在这里使用1.7。 0.2和他们已经告诉1.6.X的博客)。我今天已经安装了4次magento,但我仍然一次又一次面对同样的问题。有人能告诉我如何解决这个问题吗?任何帮助和建议都将非常可观。Magento无法在管理员用正确的用户名和密码登录
回答
,这里有一些想法。如果你已经使用谷歌浏览器安装的Magento,使用firefox打开的Magento和你的Magento目录内编辑app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
文件和注释与下面线路
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath()
// 'domain' => $cookie->getConfigDomain(),
// 'secure' => $cookie->isSecure(),
// 'httponly' => $cookie->getHttponly()
);
,并使用您的凭据登录。我希望这对你的作品!
这是您的代码中的一个错误,你必须删除逗号。 – 2014-06-27 06:28:07
他们已经有这个永久性的解决方案吗? – user1240207
但我不能为我工作得到同样的问题 –
如果您无法登录,这里是我会做什么:
- 设置您的主机文件重定向www.localhost.com为127.0.0.1
- 删除应用程序的/ etc/local.xml中
- 重新安装Magento的,使用www.localhost.com作为URL(与跳跃URL验证)
- 保存的用户名和密码,
- 清除Cookie和再试
我推荐号码3,如果你有麻烦得到登录使用正确的用户名和密码,您刚才提到修改核心代码(从来没有一个真正的好主意)
1.打开Varien.php
文件位置app\code\core\Mage\Core\Model\Session\Abstract
。
2.Find和评论波纹管代码
if (!$cookieParams['httponly']) {
unset($cookieParams['httponly']);
if (!$cookieParams['secure']) {
unset($cookieParams['secure']);
if (!$cookieParams['domain']) {
unset($cookieParams['domain']);
}
}
}
if (isset($cookieParams['domain'])) {
$cookieParams['domain'] = $cookie->getDomain();
}
来源 http://infynet.wordpress.com/2013/07/17/admin-login-fail-in-magento/
做这些步骤:
1:经历:XAMPP \ htdocs中\ Magento的\ APP \代码\核心\ Mage \ Core \ Model \ Session \ Abstract \
2:打开Varien.php文件
3:使注释行号从87至104 保存,并尝试登录...
请包括代码示例,以便用户知道他必须删除,可能有偏移的行,你现在可以肯定你没有破坏PHP与上述步骤。 –
If you are suffering to get logged in with the correct username and password. replace the code with the New code
Original code:-
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath(),
'domain' => $cookie->getConfigDomain(),
'secure' => $cookie->isSecure(),
'httponly' => $cookie->getHttponly()
);
New Code:-
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath()
/*,
'domain' => $cookie->getConfigDomain(),
'secure' => $cookie->isSecure(),
'httponly' => $cookie->getHttponly() */
);
File Path :-app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
复制 - 与上面的答案相同 –
与答案最多的答案相同,但格式更差。 –
**如James提及。这种方法适用于我。这是一个更好的选择,而不是更改代码。它适用于我127.0.0.1以及本地主机,删除应用程序/ etc/local.xml后。删除浏览器cookie。在你的浏览器中运行安装magento
localhost/magento/index.php.install。htm
并再次设置您的用户名&密码。登录到您的管理面板。我没有删除magento的数据库,所以我的数据是安全的。****
这是不正确的方式来评论饼干参数导致将来它会推动服务器,并造成很多问题。我从个人经历中了解到这一点。
最好的解决方案是将本地url重命名为一个或多或少的形式,具有典型url的外观,至少有一个点在一行。例如:http://yoursitename.local
我同意-Checkpoint Charlie-评论cookie参数可能会导致未来的麻烦。
如果您在本地服务器上安装magento,则必须使用127.0.0.1/magento_install_path IP not localhost/magento_install_path进行安装。本地主机不接受用于magento安装的cookies(或类似的东西),它与安装时的magento规则有关。
当服务器上的磁盘配额超出时,如果使用基于文件的cookie存储,则会出现会话信息无法写入磁盘的情况。
祝你好运,试图做到这一点,而不登录到管理员。 – toon81
打开magento并编辑app/code/core/Mage/Core/Model/Session/Abstract/Varien。你的Magento目录内PHP文件和评论与下面的行:$ cookieParams =阵列( '寿命'=> $ cookie-> getLifetime(), '路径'=> $ cookie->的getPath() // '域' => $ cookie-> getConfigDomain(), // '安全'=> $ cookie->的isSecure(), // '的HttpOnly'=> $ cookie-> getHttponly() ); –
你几乎完全忽略了这一点。 – toon81
其实是没有编程和设置解决这个问题的问题。
查找Varien.php这一小段代码片段和替换如下
if ((isset($cookieParams['domain'])) && !in_array("127.0.0.1", self::getValidatorData())) { $cookieParams['domain'] = $cookie->getDomain(); }
只需打开另一个浏览器,并用127.0.0.1而不是本地主机打开本地Magento的页面。
- 使用cookie清除浏览器历史记录,以获得最佳实践。
- 1. Magento无法在管理员和用户级别登录
- 2. 当用户名和密码正确时无法登录
- 3. 扩展Django的管理员登录(用户名,密码,网站)
- 4. 无法登录到Magento管理员
- 5. 无法使用正确的用户名密码和角色登录到Tomcat管理器
- 6. 用户名和密码通过ajax登录..无法登录
- 7. 用户登录期间,Django Authenticate返回无正确的用户名和密码
- 8. 无法登录magento管理
- 9. 无法在PHP中使用用户名和密码登录
- 10. 登录页面输入正确的用户名和密码
- 11. 不能用Magento的管理员登录
- 12. 无法用有效的用户名和密码登录到django管理员视图
- 13. Magento管理员登录
- 14. Magento密钥管理登录
- 15. 创建用户和管理员登录
- 16. 区分管理员和用户登录?
- 17. CodeIgniter管理员和用户登录
- 18. 布局管理员和用户登录
- 19. Magento管理员用cURL登录
- 20. Magento管理员登录不起作用
- 21. 无法使用管理员登录?
- 22. 无法在登录时检查密码和用户名
- 23. 以无密码的用户身份登录(对于管理员用例)
- 24. 登录PHP脚本用户名和密码是正确的,但不会登录
- 25. 无法登录到Phpmyadmin(用户/密码正确)
- 26. cakephp无法使用用户名和密码登录
- 27. 登录脚本 - 尽管输入正确,用户名和密码总是为false
- 28. 登录脚本无法正常工作,无法匹配用户名和密码
- 29. 在MarkLogic中忘记我的管理员用户名和密码
- 30. Magento在迁移后无法在管理员中登录
请确保一切正常与会话 – ualinker