如何调试 magento 应用程序 [英] How to debug magento application
问题描述
我正在使用 Magento,但我没有找到调试模块的好方法.例如,很多时候,我得到一个空白页面,没有 php 错误,也没有 apache 错误.例如,在后端,如果一个网格控制器没有设置好,我就没有错误.
I am working with Magento but i didn't find a very good way to debug my modules. For example, many time, i got a blank page with no php error and no apache error. For example, in backend, if one grid controller isn't well set, i don't have an error.
如何调试 Magento 模块?
How to debug Magento module?
推荐答案
听起来您想启用开发者模式.将此添加到您的 .htaccess 文件中:
It sounds like you want to enable Developer mode. Add this to your .htaccess file:
SetEnv MAGE_IS_DEVELOPER_MODE "true"
您可能还想在 index.php 中启用显示错误:
You may also want to enable display errors in index.php:
ini_set('display_errors', 1);
我发现最好的调试方法是在本地环境中使用 X-Debug.如果您无法在环境中运行 X-Debug,您还可以使用日志文件来帮助在生产环境中进行调试.
The best way I have found to debug is with X-Debug in a local environment. You can also use log files to help debug in a production environment, if your unable to run X-Debug in the environment.
我在这里有更详细的帖子:
I've got a more detailed posting here:
- https://gist.github.com/molotovbliss/2792c6c59410d75e5baf249b76413247
考虑同时安装 XDebug
这篇关于如何调试 magento 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!