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




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?

  • you have module_setup to start the xml section but prefs_setup is that another typo? – David Manners Sep 30 '13 at 13:41
  • Yes it is, sorry. you probably won't believe that I reviewed this question before posting. I think I will copy and paste next time – tony09uk Sep 30 '13 at 13:44
  • could you activate MAGE_IS_DEVELOPER_MODE and set display errors then you should get a more complete error message. – David Manners Sep 30 '13 at 14:34

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/
| improve this answer | |
  • app/code/local/Ns/Module/Model/Mysql4/Setup.php and app/code/local/Ns/Module/Model/Mysql4 are returned with -rw-r--r-- – tony09uk Sep 30 '13 at 14:41
  • I deleted those files and a recreated them, it now works. I have no idea why, I have re done the command you advised and it show the same permissions – tony09uk Sep 30 '13 at 14:48

The class name in your file does not appear to match the name that Magento is looking for. You should update Ps_Prefs_Model_Myql4_Setup to Ns_Module_Model_Mysql4_Setup in your php.

| improve this answer | |
  • Sorry, I was trying to make it more generic so that it would be something an answer that would suit others too, I will edit the question – tony09uk Sep 30 '13 at 13:37
  • 1
    Ah thought it was too easy ;) – David Manners Sep 30 '13 at 13:38

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.