問題描述
我剛剛將我的 magento 安裝從一臺本地機器服務器轉移到另一臺.現在,我無法登錄管理面板.當我轉到管理員登錄 url 時,收到以下錯誤消息:-
I just transfered my magento installation from one local machine server to another. Now, I cannot login to admin panel. When I go to the admin login url, I get the following error message:-
錯誤:404 未找到"
我的一些模塊頁面也顯示此錯誤.
Some of my module's pages also show this error.
有人能找出問題所在嗎?
Can anyone please figure out the problem?
推薦答案
最后,我找到了解決問題的方法.
Finally, I found the solution to my problem.
我查看了 Magento 系統日志文件 (var/log/system.log).在那里我看到了確切的錯誤.
I looked into the Magento system log file (var/log/system.log). There I saw the exact error.
錯誤如下:-
可恢復錯誤:參數 1 已通過到 Mage_Core_Model_Store::setWebsite()必須是一個實例Mage_Core_Model_Website,空給定,叫進來YOUR_PATHappcodecoreMageCoreModelApp.php在第 555 行并定義在YOUR_PATHappcodecoreMageCoreModelStore.php在線 285
Recoverable Error: Argument 1 passed to Mage_Core_Model_Store::setWebsite() must be an instance of Mage_Core_Model_Website, null given, called in YOUR_PATHappcodecoreMageCoreModelApp.php on line 555 and defined in YOUR_PATHappcodecoreMageCoreModelStore.php on line 285
可恢復錯誤:參數 1 已通過到Mage_Core_Model_Store_Group::setWebsite()必須是一個實例Mage_Core_Model_Website,空給定,叫進來YOUR_PATHappcodecoreMageCoreModelApp.php在第 575 行并定義在YOUR_PATHappcodecoreMageCoreModelStoreGroup.php在線 227
Recoverable Error: Argument 1 passed to Mage_Core_Model_Store_Group::setWebsite() must be an instance of Mage_Core_Model_Website, null given, called in YOUR_PATHappcodecoreMageCoreModelApp.php on line 575 and defined in YOUR_PATHappcodecoreMageCoreModelStoreGroup.php on line 227
其實我之前也遇到過這個錯誤.但是,像 Error: 404 Not Found
這樣的錯誤顯示消息對我來說是新的.
Actually, I had this error before. But, error display message like Error: 404 Not Found
was new to me.
此錯誤的原因是管理員的store_id
和website_id
應設置為0(零).但是,當您將數據庫導入新服務器時,不知何故這些值未設置為 0.
The reason for this error is that store_id
and website_id
for admin should be set to 0 (zero). But, when you import database to new server, somehow these values are not set to 0.
打開 PhpMyAdmin 并在您的數據庫中運行以下查詢:-
Open PhpMyAdmin and run the following query in your database:-
SET FOREIGN_KEY_CHECKS=0;
UPDATE `core_store` SET store_id = 0 WHERE code='admin';
UPDATE `core_store_group` SET group_id = 0 WHERE name='Default';
UPDATE `core_website` SET website_id = 0 WHERE code='admin';
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';
SET FOREIGN_KEY_CHECKS=1;
我在這里寫過這個問題和解決方案:-
I have written about this problem and solution over here:-
Magento:管理員登錄頁面中錯誤:404 未找到"的解決方案
這篇關于“未找到錯誤 404"在 Magento 管理員登錄頁面的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!