[英]magento not able to login in admin panel
我是 magento 的新手。 當我嘗試登錄管理面板時,它給了我以下錯誤。 它在我關閉會話自動啟動時起作用。 但是這樣做我的其他應用程序不能在服務器上運行。 我正在使用 magento 1.9 版本。 要添加我正在運行 nginx 而不是 apache
致命錯誤:Mage_Admin_Model_Observer::actionPreDispatchAdmin():腳本試圖執行方法或訪問不完整對象的屬性。 請確保您嘗試操作的對象的類定義“Mage_Admin_Model_User”在調用 unserialize()之前已加載或提供 __autoload() 函數以在 /var/www/html/magento/magento/ 中加載類定義app/code/core/Mage/Admin/Model/Observer.php 在第 62 行
好的,所以為了您的信息,ngnix 根本沒有解析 htaccess,Magento 嚴重依賴 htaccess 來保證安全。
在考慮您的問題之前,請知道,如果您的服務器除了本地訪問之外還有其他任何東西,那么您就有風險,因為正如您在 app/etc/local.xml 文件中看到的那樣,每個人都可以訪問,您正在給予世界您的數據庫訪問。
請完整閱讀本文檔: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;
}
}
然后,當且僅當您對文件 app/etc/local.xml 的訪問被拒絕時,請考慮在您的問題中添加 ngnix 標簽,那么具有更多 ngnix 知識的用戶可能會比我提供更多幫助(因為它更多系統管理員工作比像我這樣的“編碼器”工作)。
我只能說:如果你添加fastcgi_param PHP_VALUE "session.auto_start=0";
在該部分下
location \~\.php$ {
fastcgi_param PHP_VALUE "session.auto_start=0";
#... more come here but I'm shortening just for the specific problem
}
這應該夠了吧。
Magento 將無法在session.auto_start
啟用的情況下工作,因為在會話開始之前會發生一些操作。
如果您真的不想為其他應用禁用它,一種解決方法是編輯 Magento 的 .hatccess 並在其中添加php_flag session.auto_start 0
。
你能請清除你的緩存,並重新啟動mysqld並清除瀏覽器緩存。 能否請您分享您的網站鏈接,
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.