简体   繁体   English

Magento模块在localhost上运行良好,但在实时服务器上运行不正常

[英]Magento module works well on localhost but not on live server

I have a weird case here.... 我这里有一个奇怪的案例....

I'm making a simple magento module right now. 我现在正在制作一个简单的magento模块。 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 ) 我已经为该模块构建了admin配置(从system.xml定义) 在此输入图像描述

as seen on the image. 如图所示。 This module works very well on my localhost. 此模块在我的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 . 既可以通过magento管理区域也可以通过app/etc/modules That admin config area never appear on live server's magento installation. 该管理员配置区域永远不会出现在实时服务器的magento安装上。

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. 我一直在把它挖到magento核心代码,但是在magento核心代码周围的某个地方遇到了getSingleton()函数。 I don't understand that way-too-MVC stuff :p 我不明白那种方式 - MVC的东西:p

I would be very glad if someone could explain and guide me on this 如果有人可以解释并指导我,我会很高兴

thanks :) 谢谢 :)

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. 如果您有Windows主机,则大写/小写字符中的错误不可见,并且可以正常工作。 But as soon as it gets to linux hosting, the module will not work. 但是一旦它进入linux托管,该模块将无法正常工作。

Check the paths in the settings and folders/files - so that they match. 检查设置和文件夹/文件中的路径 - 以便它们匹配。

Usually there are three things: 通常有三件事:

  • typos in xml files (validate them with validator) xml文件中的拼写错误(使用验证程序验证它们)
  • cache is not cleared after installation (clear cache) 安装后不清除缓存(清除缓存)
  • ACL rules are not reinitiated (re-save admin roles) ACL规则未重新启动(重新保存管理员角色)

Thumb rules while deploying magento custom module on the live server- 在实时服务器上部署magento自定义模块时的Thumb规则 -

  1. Deploy your custom module 部署自定义模块
  2. Flush your all magento cache or at-least refresh them [System->Cache Management] 刷新所有magento缓存或至少刷新它们[系统 - >缓存管理]
  3. If you have enabled compilation re-run the compilation or disable compilation until the testing is done. 如果已启用编译,请重新运行编译或禁用编译,直到测试完成。 [System-Tools->Compilation] [系统工具 - >编译]

如果在magento的后台调整布局/添加自己的布局,最好清除缓存(删除var / cache /文件夹中的所有内容)并注销并重新登录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM