Home >Backend Development >PHP Tutorial >Solution to the problem of unable to log in to the PHP magento background
PHP magento background cannot log in solution
Many friends may have the same experience. Magento can be accessed normally after configuring the domain name in the server, but after configuring it locally, it cannot log in to the background. Log in with account and password. I found that there is a blank space and I cannot jump to the backend. This article introduces two methods to solve the problem of being unable to log in to the local magento backend. Friends in need can refer to it.
Solution 1:
This is a cookie problem. This problem can be solved by using non-IE core browsers such as firefox. Although the way browsers handle cookies is very similar, it is not 100% the same, other versions of Magento also have this problem.
The detailed method to correct this problem is to locate: app/code/core/Mage/Core/Model/Session/Abstract/Varien.php.
You can see something similar around line 70:
// set session cookie params /* 码农教程 http://www.manongjc.com */ session_set_cookie_params( $this->getCookie()->getLifetime(), $this->getCookie()->getPath() // 注释掉后面或删除
Solution 2:
Do not log in with localhost,
Change to your IP address to log in: for example http://192.168.1.100/ and add the backend address,
can also point to other addresses in apache,
will generally not appear on the server There is no need to modify this issue.
Magento1.9 background cannot log in problem
Open magento/app/code/core/Mage/Core/Model/Session/Abstract/varien.php
Find the following In the code, comment out the line $cookieParams['domain'] = $cookie->getDomain(); and that's it.
if (isset($cookieParams['domain'])) { $cookieParams['domain'] = $cookie->getDomain(); }
The result is as follows
if (isset($cookieParams['domain'])) { //$cookieParams['domain'] = $cookie->getDomain(); }
But after following this, an error still occurred, so I commented out the following paragraph
//if (isset($cookieParams['domain'])) { //$cookieParams['domain'] = $cookie->getDomain(); // }
Thank you for reading, I hope it can help everyone, thank you everyone for your support of this site!
For more articles related to solutions to the problem of unable to log in to the PHP magento backend, please pay attention to the PHP Chinese website!