PHPStorm and Xdebug with a D7 Site

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by jrperry on September 20, 2016 at 7:25pm

I am trying to get everything set up to use PHPStorm and Xdebug to work on a D7 site for my new job. My local environment is OS X 10.11 with Apache 2.4.18, PHP 5.5, and MySQL 5.7. So far, I haven't been able to get it to work. Here's what I've done so far:

  • Modified the /private/etc/php.ini file with the following settings:

    zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so"
    xdebug.remote_enable=1
    xdebug.remote_mode="jit"
    xdebug.remote_port="9000"
    xdebug.idekey=PHPSTORM
  • Ensured the PHP debug settings in PHPStorm were set correctly.

  • Set up the necessary server profiles and PHP Web Application settings under Run->Edit Configurations in PHPStorm.
  • Installed the Xdebug plugin for Google Chrome.

I get nothing showing up in PHPStorm when I set a breakpoint (e.g. index.php) and either try to listen for any connections from the browser plugin, or hit the debug button. Any pointers and tips from folks with experience running this or a very similar setup are greatly appreciated.

Categories: , ,

Comments

XDEBUG_SESSION_START

Posted by mortona2k on September 21, 2016 at 12:11am

You need to tell the page to start xdebug. You can use the start debug bookmarklet (or chrome plugin), but if that's not working, try adding ?XDEBUG_SESSION_START to your URL.

PHPStorm is usually pretty straightforward to set up. I click the phone icon to make it listen, but that string in my URL and it fires up my IDE when I load the page. I know this can be crazy tricky to debug though, hopefully this suggestion works.

Server in PHPStorm

Posted by markabur on September 22, 2016 at 2:30pm

I had trouble like this until I set up a server in PHPStorm, under Languages & Frameworks > PHP > Servers. I do not have any special configuration under Run > Edit Configurations. (I'm using MAMP + browser bookmarklets.)

Seattle

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /