简体   繁体   English

为什么magento有时显示空白页面,有时在管理员登录后重定向到同一个管理员登录页面?

[英]Why is magento sometime shows a blank page and sometime redirects to same admin login page after admin login?

I am using magento 1.8.1.0. 我使用的是magento 1.8.1.0。 While transferring magento from local server to live server, I could not log-in to admin dashboard. 在将magento从本地服务器转移到实时服务器时,我无法登录管理仪表板。 Sometime it shows blank page and sometime it redirects to same admin log-in page. 有时它显示空白页面,有时它会重定向到相同的管理员登录页面。

I googled a lot about this issue and tried all possible solution i found like following: 我搜索了很多关于这个问题并尝试了所有可能的解决方案,我发现如下:

  1. commenting out some elements of $configParams array in Varien.php 在Varien.php中注释掉$ configParams数组的一些元素
  2. In database table core_config_data, i changed "web/unsecure/base_url" and "web/secure/base_url/" to " http://example.com/ ", changed "web/cookie/cookie_path" to "/" and "web/cookie/cookie_domain" to ".example.com" 在数据库表core_config_data中,我将“web / unsecure / base_url”和“web / secure / base_url /”更改为“ http://example.com/ ”,将“web / cookie / cookie_path”更改为“/”和“web” / cookie / cookie_domain“to”.example.com“
  3. Edited "app/etc/local.xml" file and kept correct mysql hostname, username, password, and database name 编辑“app / etc / local.xml”文件并保留正确的mysql主机名,用户名,密码和数据库名称
  4. Cleared "var/cache" and "var/session" folder 清除“var / cache”和“var / session”文件夹
  5. Changed file permission to 775 to avoid any permission error 将文件权限更改为775以避免任何权限错误

After applying all these errors, the problem is still not resolved. 应用所有这些错误后,问题仍未解决。 Log-in to admin still shows blank page or redirects to same page. 登录管理员仍会显示空白页面或重定向到同一页面。 I think it's the issue of session cookie. 我认为这是会话cookie的问题。 I desperately need help in this. 我迫切需要帮助。 Please i beg someone to solve this issue. 请求我帮忙解决这个问题。 Thank you in advance. 先感谢您。

I solved the issue. 我解决了这个问题。 However, i saw many magento beginners struggle in their first attempt of moving magento from localhost to live server and there is no one place solution for this. 然而,我看到许多magento初学者在他们第一次尝试将magento从localhost移动到live服务器时遇到了困难,并且没有一个地方解决方案。 Here, i tried to make this post a one place solution for this issue with a useful links that i referred and some other steps so that you guys don't have to google much. 在这里,我尝试使这个帖子成为这个问题的一个地方解决方案,我提到了一些有用的链接以及其他一些步骤,这样你们就不必去谷歌了。

  1. chapagain's blog for step by step guide to move magento from one server to another chapagain的博客分步指南将magento从一台服务器转移到另一台服务器

Apart from the steps mentioned in this blog, you must do some more steps in order to make it work. 除了本博客中提到的步骤之外,您还必须执行一些其他步骤才能使其正常工作。

  1. In database table "core_config_data" change "web/cookie/cookie_path" to "/" 在数据库表“core_config_data”中将“web / cookie / cookie_path”更改为“/”
  2. Again, change "web/cookie/cookie_domain" to ".yourdomain.com" 再次,将“web / cookie / cookie_domain”更改为“.yourdomain.com”
  3. comment out some line of code in "app/code/core/Mage/Core/Model/Session/Abstract/Varien.php" shown as below 在“app / code / core / Mage / Core / Model / Session / Abstract / Varien.php”中注释掉一些代码,如下所示

    In magento 1.8.1.0, it is in line 88 to 94. 在magento 1.8.1.0中,它在第88到94行。

      $cookieParams = array( 'lifetime' => $cookie->getLifetime(), 'path' => $cookie->getPath()/*, 'domain' => $cookie->getConfigDomain(), 'secure' => $cookie->isSecure(), 'httponly' => $cookie->getHttponly() */ ); 

This should solve the issues in moving magento from localhost to live server. 这应解决将magento从localhost迁移到live server的问题。 But, if you are still having problem to log-in as admin like i had then check your log file. 但是,如果您仍然有像我一样的管理员登录问题,那么请检查您的日志文件。 In my case, i had to install "PHP curl library". 在我的情况下,我不得不安装“PHP curl库”。

I hope this will help others. 我希望这会有助于其他人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM