1
votes
  1. Have set up PHPStorm with Xdebug.
  2. Can debug a base install of Drupal7 : set breakpoints on index.php and step through - all works.
  3. However, I cannot get the page to load in a browser. I.e. when I hit continue/resume, I get "Process finished with exit code 0"

In the console window:

/Applications/MAMP/bin/php/php5.4.4/bin/php -dxdebug.remote_enable=1 -dxdebug.remote_host=127.0.0.1 -dxdebug.remote_port=9000 -dxdebug.remote_mode=req /Users/pwanwu/Sites/drupal7/index.php

( ... then the markup from the Drupal page template ... )

Then:

"Process finished with exit code 0"

And nothing appears of course in the browser window.

This works fine on Netbeans - any ideas what I am doing wrong in PHPStorm?

Thanks

1
Of course -- you are running "PHP Script" type of Run/Debug Configuration, which is for running/debugging scripts in CLI mode. Just create and use entry of appropriate type (Run | Edit Configurations... or via drop-down menu on main toolbar -- next to Run/Debug buttons) - LazyOne
You are still doing wrong. You have created configuration for PHPUnit tests (which runs in CLI mode as well). Please show a screenshot(s) of your configuration. - LazyOne
Please refer to this forum thread -- it has links to "How to debug in PhpStorm" (both "one long video that covers all" as well as few short videos for "this particular moment only"). In particular: 1) blog.jetbrains.com/phpstorm/2013/07/… and 2) jetbrains.com/phpstorm/documentation/… - LazyOne

1 Answers

0
votes

The solution is to configure the debugger using zero-configuration. You don't actually launch the debug session from within phpStorm.

Instead, you set Phpstorm to listen to incoming connections from xdebug via the browser.

In essence - this means you launch the site in the debugger, activate Phpstorm to listen on the port that you specifiy that xdebug will use (set in php.ini), and then set breakpoints in your code. You can uses browser marklets to initiate debugging from within the browser. Or you can use browser extensions/add-ons. I am now using 'The Easiest xdebug' for Firefox, and 'Xdebug enabler' for Chrome.

A full explanation of seeting up zeo-config web app debugging with Xdebug and Phpstorm is found here