Magento – module not working on unix/linux server
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.

2 Responses to “ Magento – module not working on unix/linux server ”
April 15th, 2009 at 8:26 am
I read your posts for a long time and should tell that your posts always prove to be of a high value and quality for readers.
September 30th, 2009 at 5:40 pm
Thanks a lot for this! I was starting to think I was going crazy and as a final option went to Google to see what I’d find about “case sensitive block names” – I was already starting to think that the casing had something to do with it but without finding your article I would never have stuck with it and undoubtedly I would have started looking at “more plausible” causes for the problem.
Good catch!