简体   繁体   English

magento 无法登录管理面板

[英]magento not able to login in admin panel

I am new to magento.我是 magento 的新手。 When i try to login in admin panel it gives me below error.当我尝试登录管理面板时,它给了我以下错误。 It works when i off my session auto start off.它在我关闭会话自动启动时起作用。 But doing this my other application don't work on server.但是这样做我的其他应用程序不能在服务器上运行。 I am using magento 1.9 version.我正在使用 magento 1.9 版本。 To add i am running nginx not apache要添加我正在运行 nginx 而不是 apache

Fatal error: Mage_Admin_Model_Observer::actionPreDispatchAdmin(): The script tried to execute a method or access a property of an incomplete object.致命错误:Mage_Admin_Model_Observer::actionPreDispatchAdmin():脚本试图执行方法或访问不完整对象的属性。 Please ensure that the class definition "Mage_Admin_Model_User" of the object you are trying to operate on was loaded before unserialize() gets called or provide a __autoload() function to load the class definition in /var/www/html/magento/magento/app/code/core/Mage/Admin/Model/Observer.php on line 62请确保您尝试操作的对象的类定义“Mage_Admin_Model_User”在调用 unserialize()之前已加载或提供 __autoload() 函数以在 /var/www/html/magento/magento/ 中加载类定义app/code/core/Mage/Admin/Model/Observer.php 在第 62 行

Ok, so for your information, ngnix is not parsing htaccess at all and Magento heavily rely on htaccess for security.好的,所以为了您的信息,ngnix 根本没有解析 htaccess,Magento 严重依赖 htaccess 来保证安全。

Before even considering your problem, please know that, if your server have anything else than a local access, you are at risk, because, as you can see in the app/etc/local.xml file, accessible to everyone, you are giving the world your database access.在考虑您的问题之前,请知道,如果您的服务器除了本地访问之外还有其他任何东西,那么您就有风险,因为正如您在 app/etc/local.xml 文件中看到的那样,每个人都可以访问,您正在给予世界您的数据库访问。

Please have a complete reading of this document : http://info.magento.com/rs/magentocommerce/images/MagentoECG-PoweringMagentowithNgnixandPHP-FPM.pdf where you can find a basic ngnix configuration for Magento :请完整阅读本文档:http: //info.magento.com/rs/magentocommerce/images/MagentoECG-PoweringMagentowithNgnixandPHP-FPM.pdf ,您可以在其中找到 Magento 的基本 ngnix 配置:

server {
    listen 80 default;
    server_name magento.lan www.magento.lan; # like ServerName in Apache
    root /var/www/magento; # document root, path to directory with files
    index index.html index.php;
    autoindex off; # we don’t want users to see files in directories
   location ~ (^/(app/\|includes/\|lib/\|/pkginfo/\|var/\|report/config.
xml)\|/\.svn/\|/\.git/\|/.hta.+) {
    deny all; #ensure sensitive files are not accessible
 }
location / {
    try_files $uri $uri/ /index.php?$args; # make index.php handle requests for
/
    access_log off; # do not log access to static files
    expires max; # cache static files aggressively
 }
location \~\* \.(jpeg\|jpg\|gif\|png\|css\|js\|ico\|swf)$ {
    try_files $uri $uri/ @proxy; # look for static files in root directory and
   ask backend if not successful
    expires max;
    access_log off;
 }
location @proxy {
    fastcgi_pass fpm_backend; # proxy everything from this location to backend
 }
location \~\.php$ {
    try_files $uri =404; # if reference to php executable is invalid return 404
    expires off; # no need to cache php executable files
    fastcgi_read_timeout 600;
    fastcgi_pass fpm_backend; # proxy all requests for dynamic content to
    # backend configured in upstream.conf
    fastcgi_keep_conn on; # use persistent connects to backend
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root${fastcgi_script_name};
    fastcgi_param MAGE_RUN_CODE default; # Store code is defined in
   #administration > Configuration > Manage Stores
    fastcgi_param MAGE_RUN_TYPE store;
   } 
}

Then, when and only when you have an access denied on the file app/etc/local.xml, please consider adding ngnix tag to your question, then an user with more ngnix knowledge can maybe help you further than me (since it is more a sysadmin job than a "coder" like me job).然后,当且仅当您对文件 app/etc/local.xml 的访问被拒绝时,请考虑在您的问题中添加 ngnix 标签,那么具有更多 ngnix 知识的用户可能会比我提供更多帮助(因为它更多系统管理员工作比像我这样的“编码器”工作)。

All I can say is : it looks like if you add fastcgi_param PHP_VALUE "session.auto_start=0";我只能说:如果你添加fastcgi_param PHP_VALUE "session.auto_start=0"; under the section在该部分下

location \~\.php$ {
    fastcgi_param PHP_VALUE "session.auto_start=0"; 
    #... more come here but I'm shortening just for the specific problem
}

That should do the trick.这应该够了吧。

Magento will not work with session.auto_start enabled, because some action would take place before the session start. Magento 将无法在session.auto_start启用的情况下工作,因为在会话开始之前会发生一些操作。

A workaround if you really don't want to disable it for your other app is to edit the .hatccess of your Magento and add php_flag session.auto_start 0 in it.如果您真的不想为其他应用禁用它,一种解决方法是编辑 Magento 的 .hatccess 并在其中添加php_flag session.auto_start 0

Can you Please clear your Cache, and restart mysqld and clear browser cache also.你能请清除你的缓存,并重新启动mysqld并清除浏览器缓存。 canyou please share your website link,能否请您分享您的网站链接,

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

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