pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

管理頁面上的 Magento 404

Magento 404 on Admin Page(管理頁面上的 Magento 404)
本文介紹了管理頁面上的 Magento 404的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

大約一周前,我在一個新網站的測試環境中工作.我離開了一個小時,回來了,現在無法進入管理頁面,如'http://magento.localhost.com/admin' 導致沒有 404 路由.我是唯一可以訪問它的人,它在任何意義上都不是實時的.我在 Ubuntu 中使用 VBox 來托管環境.在可能的修復方面,到目前為止我已經嘗試過......

About a week ago, I was working in a test environment for a new site. I left for an hour, came back, and now cannot get to the admin page, as in ‘http://magento.localhost.com/admin’ results in a No Route 404. I am the only one with access to this, it is not live in any sense. I am using VBox with Ubuntu to host the environment. In terms of possible fixes, so far I have tried…

  • 確保 core_store、core_store_group、core_website 和 customer_group 表 ID 設置為 0(如本文和許多其他文章中所述 - http://www.nude-webdesign.com/fix-for-magento-admin-error-404-page-未找到/)

使用/app/code/core/Mage/Core/Controller/Varien/Front.php 方法 _isAdminFrontNameMatched 來顯示 adminPath(它是‘admin’)

Playing with the /app/code/core/Mage/Core/Controller/Varien/Front.php method _isAdminFrontNameMatched to display the adminPath (it’s ‘admin’)

清除var文件夾,清空瀏覽器緩存.網站的緩存過去和現在都已關閉.

Cleared the var folder, emptied browser cache. Site’s caching was and is turned off.

將index.php"添加到 url 仍然會導致 404.

Adding 'index.php' to the url still results in a 404.

根據 Magento Admin 404,文件app/etc"/use_cache.ser' 對我來說不存在.

As per Magento Admin 404, the file 'app/etc/use_cache.ser' doesn't exist for me.

在發生這種情況的那天,我只是在玩一些我復制到我制作的模塊中的布局文件和主題的媒體查詢(所有這些都在這個問題開始發生之前恢復到它們的原始狀態).

On the day of this occurring, I was simply playing around with some layout files I had copied to a module I made and the theme’s media queries (all of which were reverted to their original state even before this problem started to occur).

有人對這里出了什么問題有什么建議嗎?這可能發生的任何其他可能的原因?

Does anyone have any suggestions as to what is wrong here? Any other possible reasons this could be happening?

謝謝你的一切.

EDIT 1:06pm 9/10/2013: 為了響應 Alan Storm 的檢索 Standard.php 正在尋找的控制器名稱的方法,我收到了許多丟失"的控制器文件.但是,在下載 1.7.0.2 的新副本以找到這些文件后,它們也不存在于其中.這是我在 Standard.php 中 Alan 的 var_dump 建議的輸出:

EDIT 1:06pm 9/10/2013: In response to Alan Storm's method of retrieving controller names that Standard.php is looking for, I was returned many "missing" controller files. However, after downloading a fresh copy of 1.7.0.2 to find those files, they weren't present in their either. Here is my output from Alan's var_dump suggestion in Standard.php:

  • ..."/public_html/app/code/core/Mage/Index/controllers/Adminhtml/Controller.php"

  • ..."/public_html/app/code/core/Mage/Index/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Paygate/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Paygate/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Paypal/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Paypal/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Widget/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Widget/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Oauth/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Oauth/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Authorizenet/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Authorizenet/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Bundle/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Bundle/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Centinel/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Centinel/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Compiler/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Compiler/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Connect/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Connect/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Downloadable/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Downloadable/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/ImportExport/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/ImportExport/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Api2/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Api2/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/PageCache/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/PageCache/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/XmlConnect/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/XmlConnect/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Adminhtml/controllers/Controller.php"

..."/public_html/app/code/core/Mage/Adminhtml/controllers/Controller.php"

..."/public_html/app/code/community/Phoenix/Moneybookers/controllers/Controller.php"

..."/public_html/app/code/community/Phoenix/Moneybookers/controllers/Controller.php"

..."/public_html/app/code/core/Mage/Captcha/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/Captcha/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/CurrencySymbol/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/CurrencySymbol/controllers/Adminhtml/Controller.php"

..."/public_html/app/code/core/Mage/CurrencySymbol/controllers/Adminhtml/IndexController.php"

..."/public_html/app/code/core/Mage/CurrencySymbol/controllers/Adminhtml/IndexController.php"

已于 2013 年 9 月 10 日下午 3:39 解決: 好的,它已修復,盡管很直白.我認為 Alan Storm 的 var_dump 建議的輸出意味著我在核心代碼池中的某處創建了一個錯誤(這不是我打算做的事情,與默認代碼搞砸了).不幸的是,為了精確學習,我隨后將其全部替換為 1.7.0.2 的默認核心代碼池.這是在艾倫用我從未調查過的更多建議更新他的原始答案之前完成的.謝謝艾倫,你太棒了.

Resolved 3:39pm 9/10/2013: Ok, it's fixed albeit rather bluntly. I took the output of Alan Storm's var_dump suggestion to mean I had created an error somewhere in the core code pool (which is not something I intended on doing, screwing with the default code that is). Unfortunately for sake of exact learning, I then replaced it all with the default core code pool of 1.7.0.2. This was done before Alan updated his original answer with more suggestions that I never investigated. Thanks Alan, you're rad.

推薦答案

無路由 404 錯誤通常表示 Magento 找不到它認為應該加載的控制器文件(通常是由于配置錯誤)

A no route 404 error usually indicates Magento can't find the controller file it thinks it should load (usually due to a misconfiguration)

最簡單的診斷方法是跳轉到 _validateControllerClassName

The easiest way to diagnose this is to hop to _validateControllerClassName

#File: app/code/core/Mage/Core/Controller/Varien/Router/Standard.php
protected function _validateControllerClassName($realModule, $controller)
{
    $controllerFileName = $this->getControllerFileName($realModule, $controller);

    if (!$this->validateControllerFileName($controllerFileName)) {  
        return false;
    }

    $controllerClassName = $this->getControllerClassName($realModule, $controller);
    if (!$controllerClassName) {
        return false;
    }

    // include controller file if needed
    if (!$this->_includeControllerClass($controllerFileName, $controllerClassName)) {
        return false;
    }

    return $controllerClassName;
}

并在返回的 false 語句周圍刪除一些日志記錄或 var_dump.這應該會告訴您 Magento 正在尋找哪些文件但找不到哪些文件 - 通常足以指出問題所在.

and drop some logging or var_dumps around the return false statments. This should tell you which files Magento is looking for and can't find — it's usually enough to point to the problem.

    if (!$this->validateControllerFileName($controllerFileName)) {  
        var_dump($controllerFileName);
        return false;
    }

    $controllerClassName = $this->getControllerClassName($realModule, $controller);
    if (!$controllerClassName) {
        var_dump($controllerClassName);
        return false;
    }

    // include controller file if needed
    if (!$this->_includeControllerClass($controllerFileName, $controllerClassName)) {
        var_dump("Couldn't include: $controllerFileName");
        return false;
    }

更新:Magento 在多個位置查找控制器文件是正常的——每個注冊為包含 adminhtml 控制器文件的模塊都需要檢查.

Update: It's normal for Magento look for the controller file in multiple places —?every module that registered as containing adminhtml controller files needs to be checked.

然而,幾乎所有要查找的控制器文件都被命名為/Controller.php.對于默認的 /admin 索引頁面,它應該是 IndexController.php.這讓我覺得你的系統認為它應該尋找一個空名稱的控制器,(可能是默認的控制器值,因為 /admin(而不是 admin/index)是您正在使用的網址)

However, almost all the controller files being looked for are named /Controller.php. For the default /admin index page this should be IndexController.php. This makes me think your system thinks it's supposed to look for a controller with a blank name, (likely the default controller value since /admin (and not admin/index) is the URL you're using)

發生這種情況的原因有很多 - 許多原因都圍繞著核心文件被更改或模塊中的配置節點設置為錯誤的值.如果下面的解決方案對您不起作用,您需要嘗試將代碼庫與干凈的代碼庫進行比較,禁用每個自定義模塊,如果修復后重新打開模塊,直到找到問題模塊,或者潛水深入調試 Magento 路由代碼,找出系統不滿意的原因.

There's myriad reasons this could happen —?many revolving around a core file being changed or a configuration node in a module set to the wrong value. If the solutions below don't work for you you'll need to try diff-ing your code base vs. a clean one, disabling every custom module and if that fixing things turn modules back on until the problem module is found, or dive deep into debugging Magento routing code to figure out why your system is unhappy.

此行為的一個常見原因是為自定義管理路徑設置的值無效(或根本沒有值)

One common cause for this behavior is an invalid value (or no value at all) being set for a custom admin path at

System -> Configuration -> Admin -> Admin Base URL -> Use Custom Admin Path

如果自定義管理路徑"的值為空,或者包含額外的 /,這可能會干擾路由.

If the value for "custom admin path" is blank, or contains and additional /, this could be interfering with the routing.

由于您無法訪問管理員,請嘗試運行以下 SQL 查詢

Since you can't access the admin, try running the following SQL query

select * from core_config_data where path like '%custom_path%';    
...
292 default 0   admin/url/use_custom_path   1
293 default 0   admin/url/custom_path   admin/

如果您看到與上述類似的結果,或者 admin/url/custom_path 為空/不存在但 admin/url/use_custom_path 仍然是 1——那是你的問題.

If you see results similar to the above, or admin/url/custom_path is blank/not-present but admin/url/use_custom_path is still 1 — then that's your problem.

嘗試從 core_config_data 中刪除這些配置值 (admin/url/use_custom_path) 和 (admin/url/use_custom_path).

Try deleting these configuration values (admin/url/use_custom_path) and (admin/url/use_custom_path) from core_config_data.

如果這不適用于您的系統,根據我的空白控制器理論,我最好的猜測是出于某種未知原因

If that doesn't apply to your system, per my blank controller theroy my best guess would be for some unknown reason the code at

#File: app/code/core/Mage/Core/Controller/Varien/Router/Admin.php
public function fetchDefault()
{
    // set defaults
    $d = explode('/', $this->_getDefaultPath());
    $this->getFront()->setDefault(array(
        'module'     => !empty($d[0]) ? $d[0] : '',
        'controller' => !empty($d[1]) ? $d[1] : 'index',
        'action'     => !empty($d[2]) ? $d[2] : 'index'
    ));
}

正在用空白值填充 controller 鍵.

is populating the controller key with a blank value.

這篇關于管理頁面上的 Magento 404的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Override Magento Config(覆蓋 Magento 配置)
What would cause a print_r and/or a var_dump to fail debugging a variable?(什么會導致 print_r 和/或 var_dump 調試變量失敗?)
How to update custom options programatically in magento?(如何在 magento 中以編程方式更新自定義選項?)
Magento - get price rules from order(Magento - 從訂單中獲取價格規則)
Magento Change Product Page Titles to Include Attributes(Magento 更改產品頁面標題以包含屬性)
Magento: adding duties/taxes to a quote during review(Magento:在審查期間向報價添加關稅/稅款)
主站蜘蛛池模板: 塑料瓶罐_食品塑料瓶_保健品塑料瓶_调味品塑料瓶–东莞市富慷塑料制品有限公司 | 粉末冶金注射成型厂家|MIM厂家|粉末冶金齿轮|MIM零件-深圳市新泰兴精密科技 | PU树脂_水性聚氨酯树脂_聚氨酯固化剂_聚氨酯树脂厂家_宝景化工 | 网站建设-临朐爱采购-抖音运营-山东兆通网络科技 | 玄米影院| 钢结构-钢结构厂房-钢结构工程[江苏海逵钢构厂] | 河南橡胶接头厂家,河南波纹补偿器厂家,河南可曲挠橡胶软连接,河南套筒补偿器厂家-河南正大阀门 | 幂简集成 - 品种超全的API接口平台, 一站搜索、试用、集成国内外API接口 | 硅胶布|电磁炉垫片|特氟龙胶带-江苏浩天复合材料有限公司 | 济南菜鸟驿站广告|青岛快递车车体|社区媒体-抖音|墙体广告-山东揽胜广告传媒有限公司 | 上海电子秤厂家,电子秤厂家价格,上海吊秤厂家,吊秤供应价格-上海佳宜电子科技有限公司 | 阿尔法-MDR2000无转子硫化仪-STM566 SATRA拉力试验机-青岛阿尔法仪器有限公司 | 波纹补偿器_不锈钢波纹补偿器_巩义市润达管道设备制造有限公司 | 钢格栅板_钢格板网_格栅板-做专业的热镀锌钢格栅板厂家-安平县迎瑞丝网制造有限公司 | 盘煤仪,盘料仪,盘点仪,堆料测量仪,便携式激光盘煤仪-中科航宇(北京)自动化工程技术有限公司 | 丙烷/液氧/液氮气化器,丙烷/液氧/液氮汽化器-无锡舍勒能源科技有限公司 | 振动时效_振动时效仪_超声波冲击设备-济南驰奥机电设备有限公司 北京宣传片拍摄_产品宣传片拍摄_宣传片制作公司-现像传媒 | 吨袋包装机|吨包秤|吨包机|集装袋包装机-烟台华恩科技 | 液压升降平台_剪叉式液压/导轨式升降机_传菜机定做「宁波日腾升降机厂家」 | 蓄电池回收,ups电池后备电源回收,铅酸蓄电池回收,机房电源回收-广州益夫铅酸电池回收公司 | led冷热冲击试验箱_LED高低温冲击试验箱_老化试验箱-爱佩百科 | 线粒体膜电位荧光探针-细胞膜-标记二抗-上海复申生物科技有限公司 | COD分析仪|氨氮分析仪|总磷分析仪|总氮分析仪-圣湖Greatlake | 户外健身路径_小区健身器材_室外健身器材厂家_价格-浩然体育 | 冷却塔减速机器_冷却塔皮带箱维修厂家_凉水塔风机电机更换-广东康明冷却塔厂家 | 外贸网站建设-外贸网站设计制作开发公司-外贸独立站建设【企术】 | 消电检公司,消电检价格,北京消电检报告-北京设施检测公司-亿杰(北京)消防工程有限公司 | 澳门精准正版免费大全,2025新澳门全年免费,新澳天天开奖免费资料大全最新,新澳2025今晚开奖资料,新澳马今天最快最新图库-首页-东莞市傲马网络科技有限公司 | 驾驶人在线_专业学车门户网站| 篮球地板厂家_舞台木地板品牌_体育运动地板厂家_凯洁地板 | 大功率金属激光焊接机价格_不锈钢汽车配件|光纤自动激光焊接机设备-东莞市正信激光科技有限公司 定制奶茶纸杯_定制豆浆杯_广东纸杯厂_[绿保佳]一家专业生产纸杯碗的厂家 | 膏方加工_丸剂贴牌_膏滋代加工_湖北康瑞生物科技有限公司 | 网站建设,北京网站建设,北京网站建设公司,网站系统开发,北京网站制作公司,响应式网站,做网站公司,海淀做网站,朝阳做网站,昌平做网站,建站公司 | 优考试_免费在线考试系统_培训考试系统_题库系统_组卷答题系统_匡优考试 | 回收二手冲床_金丰旧冲床回收_协易冲床回收 - 大鑫机械设备 | 亿立分板机_曲线_锯片式_走刀_在线式全自动_铣刀_在线V槽分板机-杭州亿协智能装备有限公司 | 合肥地磅_合肥数控切割机_安徽地磅厂家_合肥世佳电工设备有限公司 | 吉林污水处理公司,长春工业污水处理设备,净水设备-长春易洁环保科技有限公司 | 煤矿人员精确定位系统_矿用无线通信系统_煤矿广播系统 | 欧必特空气能-商用空气能热水工程,空气能热水器,超低温空气源热泵生产厂家-湖南欧必特空气能公司 | 自动螺旋上料机厂家价格-斗式提升机定制-螺杆绞龙输送机-杰凯上料机 |