在Magento管理登录页面中没有发现“404错误”。

时间:2022-10-09 15:08:34

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:-

我刚刚将magento安装从一个本地服务器转移到另一个服务器。现在,我无法登录到管理面板。当我进入管理登录url,我得到以下错误消息:-

"Error: 404 Not Found"

“错误:404 Not Found”

Some of my module's pages also show this error.

我的一些模块的页面也显示了这个错误。

Can anyone please figure out the problem?

谁能解决这个问题吗?

3 个解决方案

#1


141  

Finally, I found the solution to my problem.

最后,我找到了解决问题的办法。

I looked into the Magento system log file (var/log/system.log). There I saw the exact error.

我查看了Magento系统日志文件(var/log/system.log)。在那里我看到了确切的错误。

The error is as below:-

错误如下:-

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_PATH\app\code\core\Mage\Core\Model\App.php on line 555 and defined in YOUR_PATH\app\code\core\Mage\Core\Model\Store.php on line 285

可恢复错误:参数1传递给Mage_Core_Model_Store::setWebsite()必须是Mage_Core_Model_Website的实例,null给定,调用于YOUR_PATH\app\code\ code\core\ \ \ \core\ Model Model app中。php 555行,定义在YOUR_PATH\app\code\core\ \ \ \法师\core\模型\存储中。php在第285行

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_PATH\app\code\core\Mage\Core\Model\App.php on line 575 and defined in YOUR_PATH\app\code\core\Mage\Core\Model\Store\Group.php on line 227

参数1传递给Mage_Core_Model_Store_Group::setWebsite()必须是一个Mage_Core_Model_Website的实例,null给定,调用于YOUR_PATH\app\code\ code\core\ \core\ Model\ app中。php 575行,定义在YOUR_PATH\app\code\core\ \ \ \法师\core\ \core\ Model\Store\群组中。php在第227行

Actually, I had this error before. But, error display message like Error: 404 Not Found was new to me.

实际上,我之前有过这个错误。但是,像error: 404 Not Found这样的错误显示消息对我来说是新的。

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.

这个错误的原因是store_id和用于管理的website_id应该被设置为0(0)。但是,当您将数据库导入到新服务器时,这些值不会被设置为0。

Open PhpMyAdmin and run the following query in your database:-

打开phpadmin并在数据库中运行以下查询:-

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: Solution to "Error: 404 Not Found" in Admin Login Page

Magento:管理登录页面“错误:404 Not Found”的解决方案

#2


3  

I have just copied and moved a Magento site to a local area so I could work on it offline and had the same problem.

我刚刚复制并移动了一个Magento网站到一个地方,因此我可以在离线工作,并有同样的问题。

But in the end I found out Magento was forcing a redirect from http to https and I didn't have a SSL setup. So this solved my problem http://www.magentocommerce.com/wiki/recover/ssl_access_with_phpmyadmin

但最后我发现Magento强迫从http重定向到https,而且我没有SSL设置。这就解决了我的问题http://www.magentocommerce.com/wiki/recover/ssl_access_with_phpmyadmin

It pretty much says set web/secure/use_in_adminhtml value from 1 to 0 in the core_config_data to allow non-secure access to the admin area

在core_config_data中从1到0设置web/secure/use_in_adminhtml值,以允许对管理区域进行非安全访问

#3


-3  

Thanks to all, for me this solution worked: Magento 404 page in backoffice after login

感谢大家,对我来说这个解决方案是有效的:登录后在后台的Magento 404页面

#1


141  

Finally, I found the solution to my problem.

最后,我找到了解决问题的办法。

I looked into the Magento system log file (var/log/system.log). There I saw the exact error.

我查看了Magento系统日志文件(var/log/system.log)。在那里我看到了确切的错误。

The error is as below:-

错误如下:-

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_PATH\app\code\core\Mage\Core\Model\App.php on line 555 and defined in YOUR_PATH\app\code\core\Mage\Core\Model\Store.php on line 285

可恢复错误:参数1传递给Mage_Core_Model_Store::setWebsite()必须是Mage_Core_Model_Website的实例,null给定,调用于YOUR_PATH\app\code\ code\core\ \ \ \core\ Model Model app中。php 555行,定义在YOUR_PATH\app\code\core\ \ \ \法师\core\模型\存储中。php在第285行

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_PATH\app\code\core\Mage\Core\Model\App.php on line 575 and defined in YOUR_PATH\app\code\core\Mage\Core\Model\Store\Group.php on line 227

参数1传递给Mage_Core_Model_Store_Group::setWebsite()必须是一个Mage_Core_Model_Website的实例,null给定,调用于YOUR_PATH\app\code\ code\core\ \core\ Model\ app中。php 575行,定义在YOUR_PATH\app\code\core\ \ \ \法师\core\ \core\ Model\Store\群组中。php在第227行

Actually, I had this error before. But, error display message like Error: 404 Not Found was new to me.

实际上,我之前有过这个错误。但是,像error: 404 Not Found这样的错误显示消息对我来说是新的。

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.

这个错误的原因是store_id和用于管理的website_id应该被设置为0(0)。但是,当您将数据库导入到新服务器时,这些值不会被设置为0。

Open PhpMyAdmin and run the following query in your database:-

打开phpadmin并在数据库中运行以下查询:-

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: Solution to "Error: 404 Not Found" in Admin Login Page

Magento:管理登录页面“错误:404 Not Found”的解决方案

#2


3  

I have just copied and moved a Magento site to a local area so I could work on it offline and had the same problem.

我刚刚复制并移动了一个Magento网站到一个地方,因此我可以在离线工作,并有同样的问题。

But in the end I found out Magento was forcing a redirect from http to https and I didn't have a SSL setup. So this solved my problem http://www.magentocommerce.com/wiki/recover/ssl_access_with_phpmyadmin

但最后我发现Magento强迫从http重定向到https,而且我没有SSL设置。这就解决了我的问题http://www.magentocommerce.com/wiki/recover/ssl_access_with_phpmyadmin

It pretty much says set web/secure/use_in_adminhtml value from 1 to 0 in the core_config_data to allow non-secure access to the admin area

在core_config_data中从1到0设置web/secure/use_in_adminhtml值,以允许对管理区域进行非安全访问

#3


-3  

Thanks to all, for me this solution worked: Magento 404 page in backoffice after login

感谢大家,对我来说这个解决方案是有效的:登录后在后台的Magento 404页面