PHPStorm and Xdebug with a D7 Site

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
jeremyrperry's picture

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.

Comments

XDEBUG_SESSION_START

mortona2k's picture

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

markabur's picture

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: