Im stumped!
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.
For example this URL: [domain]/shop/index.php/bbyd_sync/index/ Causes a 404 on live but returns “done” locally.
Here is my config.xml:
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.phpOf course I have /app/code/etc/modules/Bbyd_Sync.xml as well.
Anybody have some bright ideas about problems occurring between Mac & Linux platforms for Magento? Perhaps casing of files/directories?
BTW, this is Magento 1.5.
Any help appreciated…(my 1st request so please be gentle!)
…………………………………
Step 0: Clear your cache AND sessions on the live server.
Step 1: Check if your module is installed using the free/open-source Module List Module
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;
}
Step 3: Debug which 404 page it is.
…………………………………
Just log out and log in back again admin panel and things will work again Image may be NSFW.
Clik here to view.
…………………………………
Resolved!
I could not make progress with Alan’s advice, however when I re-built the extension with the ModuleCreator, it all worked without error.