Magento – class not found but class is created

configurationxml

I am receiving the following error

Fatal error: Class 'Ns_Module_Model_Mysql4_Setup' not found in /Users/tony09uk/Sites/magentoDevTest/app/code/core/Mage/Core/Model/Resource/Setup.php on line 234

I have added this file in my config and the exact same file path has been created for the setup file

etc/config.xml

<global>        
    <models>
        .....
    </models>

    <resources>
        <module_setup>
            <setup>
                <module>Ns_Module</module>
                <class>Ns_Module_Model_Mysql4_Setup</class>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </module_setup> 
        .....
    </resources>

The file path is Ns_Module_Model_Mysql4_Setup

class Ns_Module_Model_Mysql4_Setup
extends Mage_Core_Model_Resource_Setup 
{}

Why can't magento find this? I have checked the file paths are the same and checked the casing is the same, what am I doing wrong?

Best Answer

Check the file permissions. Remember the webserver typically runs as a different user so all files need to have read permission for all users. Also the directory it's in must be similarly executable.

chmod a+r app/code/local/Ns/Module/Model/Mysql4/Setup.php
chmod a+rx app/code/local/Ns/Module/Model/Mysql4/
Related Topic