Answers.Body: <p>I can confirm that Win8.1 + PHPStorm + xDebug and plugin code works fine.</p>
  
  <p>Are you symlink'ing (using mklink in Windows) to your plugin code by chance? xDebug won't follow symlink's by default and at least in PHPStorm, you have to explicitly setup the path mapping in your project's settings to tell PHPStorm/xDebug where the <em>actual</em> paths to your symlink'ed files live.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-06T23:33:44.800Z
Answers.Text: i dont think i'm doing that, certainly not intentionally. i wonder if its eclipse. good to know phpstorm will work
Answers.UserDisplayName: Andrew Wisener
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-06T17:18:07.410Z
Answers.LastActivityDate: 2014-09-06T22:42:45.107Z
Answers.LastEditDate: 2014-09-06T22:42:45.107Z
Answers.UserDisplayName: Brad Bell
Answers.Body: <p>PHPStorm debugs fine. So the solution is to use that for debugging Craft sites</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-26T21:06:32.467Z
Answers.Text: I'm using IntelliJ and can confirm debugging works on the index.php however it never comes to the breakpoint of my Plugin. How did you get this to work for PHPStorm since they are "almost" the same IDE's Thanks in advance!
Answers.UserDisplayName: IColorfield
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-11-26T22:21:16.433Z
Answers.Text: @IColorfield: Probably worth asking as a brand new question... this is a very old thread. Feel free to link back to this thread for reference.
Answers.UserDisplayName: Lindsey D
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-09T01:32:39.293Z
Answers.LastActivityDate: 2014-09-09T01:32:39.293Z
Answers.UserDisplayName: Andrew Wisener
Answers.Body: <p>Andrew, you could always use Whoops. <a href="https://github.com/filp/whoops" rel="nofollow">https://github.com/filp/whoops</a>. </p>
  
  <p>What you could do is just install Whoops through composer in your plugin directory (here is an example of my composer.json file (<a href="http://d.pr/i/trWp" rel="nofollow">http://d.pr/i/trWp</a>). </p>
  
  <p>Then you could include this within your plugin:</p>
  
  <pre><code>include(CRAFT_BASE_PATH . 'plugins/(your directory)/vendor/autoload.php');
  </code></pre>
  
  <p>That's basically it. Here is an example of an exception thrown within my plugin with a full stack trace. </p>
  
  <p><a href="http://d.pr/i/Ar8v" rel="nofollow">http://d.pr/i/Ar8v</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-06T23:32:15.640Z
Answers.Text: hey matt, that looks good. it seems to me that php coders much prefer dumping to the screen rather than debugging. I come from a M$ background, in visual studio .net  coder not debugging is unheard of.
Answers.UserDisplayName: Andrew Wisener
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-06T23:35:40.600Z
Answers.Text: Come from a .NET background as well. Give PHPStorm a go. It's by far the closest thing you'll get to VS in the PHP world.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-07T04:01:53.180Z
Answers.Text: I'll second that. PHPStorm is by far the best IDE for PHP IMO. I use that along with Xdebug as well, just not for everything. I don't know the huge difference in "debugging" from the IDE and outputting most of what the IDE debugger gives you in the browser. I know with PHP you don't have to compile everything like .NET so it's probably more similar than you think. But I am not from the .NET world so I really don't know. Hope PHPStorm works well for you!
Answers.UserDisplayName: Matt Green
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-06T04:32:11.603Z
Answers.LastActivityDate: 2014-09-06T04:32:11.603Z
Answers.UserDisplayName: Matt Green
Body: <p>I'm new to php development, so I'm probably doing something silly...</p>
  
  <p>I have setup Craft running in a Vagrant VM on Windows 8. I am using XDebug and Eclipse as my IDE. It all works beautifully! However I cannot debug any of my plugin code. I can step into the Craft code but it never breaks on any plugin actions. I suspect its something to do with the way the Craft code is calling the actions, it looks like it is using some sort of reflection to call the methods of the plugin class. Can anyone help? Is there a way to debug plugin code? Or perhaps a better IDE if it is Eclipse that has this limitation?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-09-05T04:12:38.243Z
Comments.Text: Could this be a routing issue? Are you using {siteUrl} + config.php to correct for the right site url? What kinds of errors are you seeing?
Comments.UserDisplayName: Adam McCombs
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-09-05T11:10:11.870Z
Comments.Text: no errors, the debugger simply doesn't break in any plugin code. The code runs but the debugger doesn't work. non plugin craft code debugs fine.
Comments.UserDisplayName: Andrew Wisener
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-09-06T03:10:53.023Z
Comments.Text: Adam, just rereading your comment, what do you mean about using config.php to correct for right site url? I have not come across that.
Comments.UserDisplayName: Andrew Wisener
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-09-06T20:35:17.043Z
Comments.Text: Hey Andrew - in general.php you can set dynamic urls. So in your db, you only use {siteUrl} but you can have multiple setups for your different environments.
  
  if ($_SERVER['SERVER_NAME'] == 'local.site')
  {
      return array(
          'omitScriptNameInUrls' => true,
          'devMode' => true,
          'environmentVariables' => array(
              'siteUrl'        => 'http://local.site/',
              'fileSystemPath' => '',
          )
      );
  }
Comments.UserDisplayName: Adam McCombs
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2014-09-06T20:36:59.137Z
Comments.Text: That is to say if this isn't set correctly or your Craft install is still pointing to your localhost vs. the server it's living on, it could cause all sorts of problems.
Comments.UserDisplayName: Adam McCombs
Tags: <debugging>
Title: Debugging Craft plugin actions
ThreadText: # Debugging Craft plugin actions
  
  (Asked by: username_0 on 2014-09-05)
  
  I'm new to php development, so I'm probably doing something silly...
  
  I have setup Craft running in a Vagrant VM on Windows 8. I am using XDebug and Eclipse as my IDE. It all works beautifully! However I cannot debug any of my plugin code. I can step into the Craft code but it never breaks on any plugin actions. I suspect its something to do with the way the Craft code is calling the actions, it looks like it is using some sort of reflection to call the methods of the plugin class. Can anyone help? Is there a way to debug plugin code? Or perhaps a better IDE if it is Eclipse that has this limitation?
  
  **Tags:** debugging
  
  > **Comments:**
  > **username_1**: Could this be a routing issue? Are you using {siteUrl} + config.php to correct for the right site url? What kinds of errors are you seeing?  
  > **username_0**: no errors, the debugger simply doesn't break in any plugin code. The code runs but the debugger doesn't work. non plugin craft code debugs fine.  
  > **username_0**: username_1, just rereading your comment, what do you mean about using config.php to correct for right site url? I have not come across that.  
  > **username_1**: Hey username_0 - in general.php you can set dynamic urls. So in your db, you only use {siteUrl} but you can have multiple setups for your different environments.  if ($_SERVER['SERVER_NAME'] == 'local.site') {     return array(         'omitScriptNameInUrls' => true,         'devMode' => true,         'environmentVariables' => array(             'siteUrl'        => 'http://local.site/',             'fileSystemPath' => '',         )     ); }  
  > **username_1**: That is to say if this isn't set correctly or your Craft install is still pointing to your localhost vs. the server it's living on, it could cause all sorts of problems.  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_2 on 2014-09-06. Score: 2
  
  I can confirm that Win8.1 + PHPStorm + xDebug and plugin code works fine.
  
  Are you symlink'ing (using mklink in Windows) to your plugin code by chance? xDebug won't follow symlink's by default and at least in PHPStorm, you have to explicitly setup the path mapping in your project's settings to tell PHPStorm/xDebug where the *actual* paths to your symlink'ed files live.
  
  > **Comments:**
  > **username_0**: i dont think i'm doing that, certainly not intentionally. i wonder if its eclipse. good to know phpstorm will work  
  
  ---
  
  ### Answer by username_0 on 2014-09-09. Score: 1
  
  PHPStorm debugs fine. So the solution is to use that for debugging Craft sites
  
  > **Comments:**
  > **username_3**: I'm using IntelliJ and can confirm debugging works on the index.php however it never comes to the breakpoint of my Plugin. How did you get this to work for PHPStorm since they are "almost" the same IDE's Thanks in advance!  
  > **username_4**: @username_3: Probably worth asking as a brand new question... this is a very old thread. Feel free to link back to this thread for reference.  
  
  ---
  
  ### Answer by username_5 on 2014-09-06. Score: 1
  
  username_0, you could always use Whoops. <https://github.com/filp/whoops>.
  
  What you could do is just install Whoops through composer in your plugin directory (here is an example of my composer.json file (<http://d.pr/i/trWp>).
  
  Then you could include this within your plugin:
  
  ```
  include(CRAFT_BASE_PATH . 'plugins/(your directory)/vendor/autoload.php');
  
  ```
  
  That's basically it. Here is an example of an exception thrown within my plugin with a full stack trace.
  
  <http://d.pr/i/Ar8v>
  
  > **Comments:**
  > **username_0**: hey username_5, that looks good. it seems to me that php coders much prefer dumping to the screen rather than debugging. I come from a M$ background, in visual studio .net  coder not debugging is unheard of.  
  > **username_2**: Come from a .NET background as well. Give PHPStorm a go. It's by far the closest thing you'll get to VS in the PHP world.  
  > **username_5**: I'll second that. PHPStorm is by far the best IDE for PHP IMO. I use that along with Xdebug as well, just not for everything. I don't know the huge difference in "debugging" from the IDE and outputting most of what the IDE debugger gives you in the browser. I know with PHP you don't have to compile everything like .NET so it's probably more similar than you think. But I am not from the .NET world so I really don't know. Hope PHPStorm works well for you!  
  
  ---
  
  