Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debug Project in PhpStorm

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

like image 385
Pratik Avatar asked May 08 '15 13:05

Pratik


1 Answers

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

like image 195
Pratik Avatar answered Sep 29 '22 10:09

Pratik