1

I have created a custom controller on my magento project.It worked fine since i did the development in windows environment.But now i have moved to a Linux environment.Now all of my custom modules are not working.I can't find the problem.please help

When i type this URL in my windows server it works but in Linux it redirect to 404 page. base_path/index.php/Catalogues

This is my code.

/app/etc/modules/AllOther_Catalogues.xml

<?xml version="1.0"?>
<config>
    <modules>
        <AllOther_Catalogues>
            <active>true</active>
            <codePool>local</codePool>
        </AllOther_Catalogues>
    </modules>
</config>

app\code\local\AllOther\Catalogues\etc\config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Magentoexplorer_Catalogues>
            <version>0.1.0</version>
        </Magentoexplorer_Catalogues>
    </modules>
    <frontend>
        <routers>
            <Catalogues>
                <use>standard</use>
                <args>
                    <module>AllOther_Catalogues</module>
                    <frontName>Catalogues</frontName>
                </args>
            </Catalogues>
        </routers>
    </frontend>
</config>

app\code\local\AllOther\Catalogues\controllers\indexController.php

<?php

class AllOther_Catalogues_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {

        $this->loadLayout();
        $block = $this->getLayout()->createBlock(
        'Mage_Core_Block_Template',
        'invoice_',
        array('template' => 'allother/catalogues.phtml')
        );

       $resource = Mage::getSingleton('core/resource');
       $write = $resource->getConnection('core_write');
       $select = $write->select()
      ->from(['tbl' =>"sidcms_block"], ['*'])
      ->where('identifier = ?', "catalogues");

       $results = $write->fetchAll($select);

       $block->assign(array('result'=>$results));


        $this->getLayout()->getBlock('content')->append($block);
        $this->getLayout()->getBlock('head')->setTitle($this->__('Catalogues'));
        $this->renderLayout();

  }
}
0

Please check if there is any space in you config.xml file between tags.
Also try to replace
<routers> <Catalogues> with
<routers> <catalogues>

OR

If you are using linux platform then give proper permission of all files and folders. I think this is occurring due to file/folder permission.Change the Linux permissions for all files in your Magento base directory to readable and writable by the owning user (you).Set permissions to 664 for files and 775 for folders. 775 for files will work too. Set 777 for media and var , only 2 folders need to be writable by everyone.

OR

Check your controller's file name it should be IndexController.php instead of indexController.php

  • no tried that also.the problem is still there – pavithra Mar 7 '17 at 10:19
  • try to change file name to IndexController.php instead of indexController.php – aman Mar 7 '17 at 10:25
  • Also enable developer mode so that you can see if there is any parsing error or not. – aman Mar 7 '17 at 10:25
  • I have also update the answer please check that also. – aman Mar 7 '17 at 10:36
  • thank you @aman by setting IndexController.php instead of indexController.php the problem got solved. – pavithra Mar 7 '17 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.