Magento – module not working on unix/linux server
- Thursday, March 19th, 2009 -
I am writing this more as a reminder to my self and anyone else who makes a module for magento. I created a module and it was working fine locally on my windows machine. When I uploaded the site to a unix/linux server the module seemed to stop functioning correctly. Here was the problem:
I had a Block class called SideNavigation.php. I called it using a layout file. It was suppose to provide custom CMS functionality with a side navigation menue.
Below is the code from the layout file that did not work.
<?xml version="1.0"?>
<layout version="0.1.0">
<cms_page>
<reference name="left">
<block type="advancedcms/sidenavigation" name="advancedcms.sidenav" />
</reference>
</cms_page>
</layout>
The reason this did not work is because unix machines are case sensitive where as Windows is not case sensitive. Magento turns sidenavigation in the above code into Sidenavigation. It allways capitalizes the first letter. So windows would match Sidenavigation to SideNavigation because it is case insensitive. unix/linux machines would not match Sidenavigation to SideNavigation. So I had to change my code to the following to work.
<?xml version="1.0"?>
<layout version="0.1.0">
<cms_page>
<reference name="left">
<block type="advancedcms/sideNavigation" name="advancedcms.sidenav" />
</reference>
</cms_page>
</layout>
Now magento turns it into SideNavigation and the layout file correctly points to the SideNavigation.php file.
Hope this helps anyone with a simmilar problem.
Just a closing thought: Wouldn’t it be nice to be able to make windows case sensitive, so you don’t have to do trouble shooting like this.
