Php Magento分机404错误
我被难住了 我有一个自定义扩展,在Mac Leopard上本地运行得很好,但是在将live推送到主机(Centos Linux)后,我在尝试调用前端路由器时遇到了Magento 404错误 例如,此URL: [domain]/shop/index.php/bbyd_sync/index/在live上导致404,但在本地返回“done” 以下是我的config.xml:Php Magento分机404错误,php,xml,linux,macos,magento,Php,Xml,Linux,Macos,Magento,我被难住了 我有一个自定义扩展,在Mac Leopard上本地运行得很好,但是在将live推送到主机(Centos Linux)后,我在尝试调用前端路由器时遇到了Magento 404错误 例如,此URL: [domain]/shop/index.php/bbyd_sync/index/在live上导致404,但在本地返回“done” 以下是我的config.xml: <config> <modules> <Bbyd_Sync> <
<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>
我的应用程序/代码/本地结构(我在这里使用字母大小写):
当然我还有/app/code/etc/modules/Bbyd_Sync.xml
对于Magento的Mac和Linux平台之间出现的问题,有人有什么好主意吗?可能是文件/目录的大小写
顺便说一句,这是Magento 1.5
感谢您的任何帮助…(我的第一个请求,所以请保持温和!)步骤0:清除live server上的缓存和会话 步骤1:检查您的模块是否使用免费/开源软件安装 步骤2:使用以下方法删除一些调试代码。var_转储将告诉您Magento的路由器正在使用您的模块查找哪些文件/类,但找不到
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:调试。已解决
我无法按照Alan的建议取得进展,但是,当我使用重新构建扩展时,它完全正常工作。只需注销并再次登录管理面板,一切就会恢复正常:-)谢谢Alan。我很高兴你能在这里投稿……我一直在关注你的文章;)然而,在成功执行步骤0和1之后,步骤1我根本没有得到任何响应…即使我尝试回显validateControllerClassName中的任何内容。即使从core_资源中删除,也可能没有任何影响。关于哪个404,好吧,这是我们的坏noRoute 404生成的哎哟。任何提示?跳到前端控制器并从Mage_Core_controller_Varien_front开始调试::dispatchi收到此错误。.前端控制器达到100路由器匹配迭代只是为了确认,前端路由器似乎只有问题-扩展已成功安装,我可以在管理员中看到我的自定义配置页面。这并不是你问题的答案。你不应该接受自己的答案。
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
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;
}