I have been searching for a satisfactory answer on the net and StackOverflow without success. How should I debug Magento as a whole application — not a single file — using the PhpStorm IDE? You can do this in Visual Studio, Netbeans, and IntelliJ IDEA but I need to know how to debug an application, such as Magento, using PhpStorm.

When I try to run the debugger on a controller, such as C:\xampp\htdocs\coinandbuillion\app\code\core\Mage\Checkout\controllers\CartController.php, a bunch of errors get thrown because PhpStorm is trying to execute the file directly rather than working through the application dispatcher in index.php.

So does anyone know how to debug automatically from the initialization point of application till the end?

Here is snapshot what i got. I cant debug after that button click.

enter image description here

share|improve this question
    
I know you can compile your PHP code with Facebook's HipHop, when used in debug mode you can debug your entire project. – Daan May 8 '15 at 13:16
    
Sounds like you are trying to execute your controller file directly ... instead of doing actual app debugging. Have you seen these links yet? It has all info: confluence.jetbrains.com/display/PhpStorm/… – LazyOne May 8 '15 at 13:28
    
@LazyOne , I tried App debugging too , but it starts and ends directly without debugging. Can any one explain me how do I debug app properly ? – Pratik C Joshi May 8 '15 at 13:31
    
Please show screenshots/screencast of such debug configuration -- maybe you are doing it wrongly. – LazyOne May 8 '15 at 13:34
2  
What you have described as your solution is different to what you have asked originally (PHP's own server vs XAMPP environment) .. but it works for you (which is an important) so it's all good. – LazyOne May 11 '15 at 9:20
up vote 16 down vote accepted

Finally I did it !!! :) Please refer steps I followed.

Install Jetbrain's chrome extension from Here.

Now follow steps as below.

chrome extension

Steps to activate phpstorm debugging for Whole Project automatically when you refresh page to trigger Phpstorm Debugger automatically !!!!

In 3rd snapshot in image. your Built in server port(mine is 63342) may be different for you,I didnt change it , it was already there(default), I have just shown it. I changed other options only.

That's it !!

Edit 1:

IF you have problem writing all xdebug setting in php.ini from diagram 1, here it is text version: Don't change paths exactly like i have because you may have xampp/wamp installed on other drive, in different folder. So please add paths like zend_extension accordingly.

[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
xdebug.profiler_append = 0
;xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "C:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.trace_output_dir = "C\xampp\tmp"
xdebug.remote_port = 9000
xdebug.idekey=PHPSTORM

Ensure following :

  1. Ensure you have Installed Chrome Extension from Here

  2. Make sure xampp/wamp server is running.

  3. Make sure Xdebug debugger is configured.

    If not , Goto File->Settings -> search PHP and follow diagram as follows

xdebug

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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