Magento Extension 404错误 [英] Magento Extension 404 Error

查看:66
本文介绍了Magento Extension 404错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很沮丧!

我有一个自定义扩展名,可以在Mac Leopard上很好地在本地工作,但是在将主机推送到主机(Centos Linux)后,当我尝试调用前端路由器时,出现Magento 404错误.

I have a custom extension that works beautifully locally on Mac Leopard, however after pushing live to the host (Centos Linux) I get a Magento 404 error when I try to call the frontend router.

例如,该URL: [domain]/shop/index.php/bbyd_sync/index/导致直播404,但在本地返回完成".

For example this URL: [domain]/shop/index.php/bbyd_sync/index/ Causes a 404 on live but returns "done" locally.

这是我的config.xml:

Here is my config.xml:

<config>
<modules>
    <Bbyd_Sync>
        <version>0.1.0</version>
    </Bbyd_Sync>
</modules>
<crontab>
    <jobs>
        <bbyd_sync>
            <schedule>
                <cron_expr>*/5 * * * *</cron_expr>
            </schedule>
            <run>
                <model>sync/run::runAll</model>
            </run>
        </bbyd_sync>
    </jobs>
</crontab>
<frontend>
    <routers>
        <sync>
            <use>standard</use>
            <args>
                <module>Bbyd_Sync</module>
                <frontName>bbyd_sync</frontName>
            </args>
        </sync>
    </routers>
</frontend>
<admin>
    <routers>
        <wrapper>
            <use>admin</use>
            <args>
                <module>Bbyd_Sync</module>
                <frontName>syncadmin</frontName>
            </args>
        </wrapper>
    </routers>
</admin>
<adminhtml>
    <acl>
        <resources>
            <all>
                <title>Allow Everything</title>
            </all>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <bbyd translate="title" module="run">
                                        <title>BBYD Sync</title>
                                        <sort_order>808</sort_order>
                                    </bbyd>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
    <translate>
        <modules>
            <Bbyd_Sync>
                <files>
                    <default>BBYD_Sync.csv</default>
                </files>
            </Bbyd_Sync>
        </modules>
    </translate>
</adminhtml>
<global>
    <models>
        <sync>
            <class>Bbyd_Sync_Model</class>
            <resourceModel>sync_mysql4</resourceModel>
        </sync>
        <sync_mysql4>
            <class>Bbyd_Sync_Model_Mysql4</class>
            <entities>
                <run>
                    <table>bbyd_sync</table>
                </run>
            </entities> 
        </sync_mysql4>
    </models>
    <helpers>
        <sync>
            <class>bbyd_sync_helper</class>
        </sync>
    </helpers>
    <resources>
        <sync_setup>
            <setup>
                <module>Bbyd_Sync</module>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </sync_setup>
        <sync_write>
            <connection>
                <use>core_write</use>
            </connection>
        </sync_write>
        <sync_read>
            <connection>
                <use>core_read</use>
            </connection>
        </sync_read>      
    </resources>  
</global>
<default>
    <bbyd>
        <setup>
            <send_new_customer_account_email>0</send_new_customer_account_email>
        </setup>
        <cron>
            <log_file_name>bbyd_sync.log</log_file_name>
        </cron>
    </bbyd>
</default>

我的IndexController.php

My IndexController.php

class Bbyd_Sync_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction() {
        echo "done";
    }
}

我的应用程序/代码/本地结构(我在这里使用字母大小写):

My app/code/local structure (Im using the letters cases as is here):

Bbyd
    Sync
        controllers
            IndexController.php
        etc
            config.xml
            system.xml
        Helper
            Data.php
        Model
            Run.php
            Mysql4
                Run.php
        sql
            sync_setup
                mysql4-install-0.1.0.php

我当然也有/app/code/etc/modules/Bbyd_Sync.xml.

Of course I have /app/code/etc/modules/Bbyd_Sync.xml as well.

对于Mac和Mac之间发生的问题,任何人都有一些聪明的主意.适用于Magento的Linux平台?也许文件/目录的大小写?

Anybody have some bright ideas about problems occurring between Mac & Linux platforms for Magento? Perhaps casing of files/directories?

顺便说一句,这是Magento 1.5.

BTW, this is Magento 1.5.

任何帮助表示赞赏...(我的第一个要求,请保持温柔!)

Any help appreciated...(my 1st request so please be gentle!)

推荐答案

步骤0:清除实时服务器上的缓存和会话.

Step 0: Clear your cache AND sessions on the live server.

第1步:检查是否使用免费的/开源的模块列表模块

Step 1: Check if your module is installed using the free/open-source Module List Module

第2步:通过以下方法删除一些调试代码. var_dumps会告诉您Magento路由器要在模块中查找哪些文件/类,但找不到.

Step 2: Drop some debugging code in the following method. The var_dumps will tell you which files/classes Magento's routers are looking for with your module, but can't find.

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)) {
        var_dump($controllerFileName);
        return false;
    }

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

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

    return $controllerClassName;
}   

第3步:调试这是404页.

这篇关于Magento Extension 404错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆