Magento module works well on localhost but not on

2020-04-14 16:06发布

问题:

I have a weird case here....

I'm making a simple magento module right now. Some kind of script injection module (similar to google analytics module). I've built the admin config for that module (which is defined from system.xml)

as seen on the image. This module works very well on my localhost. But it's getting weird on the live server. The modules looks like it doesn't enabled at all although I have totally make sure it's all already enabled. Both via magento admin area and also via app/etc/modules. That admin config area never appear on live server's magento installation.

does anybody know what's the issue with this problem? or at least tell me how and where should I debug it? I've been digging it to magento core code but getting stuck on getSingleton() function somewhere around magento core code. I don't understand that way-too-MVC stuff :p

I would be very glad if someone could explain and guide me on this

thanks :)

回答1:

The most common problems are associated with case sensitivity. If you have Windows hosting, then the error in the uppercase/lowercase characters is not visible and it works. But as soon as it gets to linux hosting, the module will not work.

Check the paths in the settings and folders/files - so that they match.



回答2:

Usually there are three things:

  • typos in xml files (validate them with validator)
  • cache is not cleared after installation (clear cache)
  • ACL rules are not reinitiated (re-save admin roles)


回答3:

If you adjust the layout/add your own layout in the backoffice of magento, it's best to clear the cache (remove everything in the var/cache/ folder) and to logout and re-login.



回答4:

Thumb rules while deploying magento custom module on the live server-

  1. Deploy your custom module
  2. Flush your all magento cache or at-least refresh them [System->Cache Management]
  3. If you have enabled compilation re-run the compilation or disable compilation until the testing is done. [System-Tools->Compilation]


标签: php magento