3

I'm new to Magento. I'm used to working in dot net, where you can place the debugger where you need, so that you can identify bugs and other issues.

So, now I am learning Magento with phpStorm. Please let me know how to set line by line debugging from my custom module?

thanks in advance.

3
  • Take a look at this: jetbrains.com/phpstorm/webhelp/configuring-xdebug.html
    – Marius
    Oct 11, 2013 at 10:15
  • @Marius, we are placing debugger successfully in any files, but the problem is the debugger is not going to the line by line. suppose I have function (<?php echo $this->mymethod() ?>) in test.phtml file when we place the debugger it is not going the mymethod. it is showing error can't find or it is non-object method. Oct 11, 2013 at 10:50
  • use the Step into button on the debugger. Or if it shows a php error maybe the method does not exist.
    – Marius
    Oct 11, 2013 at 10:53

1 Answer 1

3

Nothing specific to setup, in your server install xdebug debugger, make sure that you see it listed in phpinfo output in a file in your Magento root. Then turn on "Start listen for php debug connections" from Run menu or toolbar icon. Place your break points wherever you want. Use php storm bookmarklet to initiate debug session with cookie. If all is successful PhpStorm will popup on your break point whenever the code reaches it.

2
  • HI petar, we are placing debugger successfully in any files, but the problem is the debugger is not going to the line by line. suppose I have function (<?php echo $this->mymethod() ?>) in test.phtml file when we place the debugger it is not going the mymethod. it is showing error can't find or it is non-object method. Oct 11, 2013 at 10:51
  • If you place a break point does it stop there? If it does then debugger works. Then it is matter to point correct files in the setup. Usually I have configured deployment server in PhpStorm settings which is for the project in question and configured mapping of the files for it. This way PhpStorm is not wandering where to find files Oct 11, 2013 at 17:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.