0

Whan can I do to get breakpoints working in PHPStorm / PHP internal web server?

My environment is:

OSX 10.9.4 PHPStorm 7.1 XAMPP 1.8.3-4 / PHP 5.5.11 with Xdebug v2.2.3

I have set a few options in /Applications/XAMPP/xamppfiles/etc/php.ini:

[xdebug]
zend_extension="/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so"
xdebug.remote_enable=On
xdebug.profiler_enable=On
xdebug.profiler_output_dir="/Applications/XAMPP/xamppfiles/temp/"
xdebug.remote_log=/Applications/XAMPP/xamppfiles/logs/xdebug.log

PHPStorm settings:

PHP Home: /Applications/XAMPP/bin The settings dialog tells me that I have PHP 5.5.11 and Xdebug 2.2.3 which is what I expected.

I use Chrome and have the Jetbrains IDE Support extension installed.

When I hit "Debug" the browser displays the output of the PHP script along with a messages "JetBrains IDE Support is debugging this tab"

Whenever I set a breakpoint the breakpoint is ignored altogether.

When I use the same PHP environment from Netbeans 8, breakpoints work.

Same problem on Windows 8.

4
  • Screenshot of your Run/Debug config please. Right now it sounds like you are using JavaScript debug instead of PHP. Commented Aug 13, 2014 at 9:47
  • You are right, problem solved. Thanks a lot. Have to be careful when starting debug for the first time and select the correct mode. Commented Aug 13, 2014 at 20:59
  • Nope, not really. I am still in the process of finding a reliable debug workflow. In Netbeans I set a breakpoint, hit "debug" and bam, the PHP script is suspended at the breakpoint. In PHPstorm atm I am stuck in between switching "listen to debug connections" on, hitting "Debug", hitting the "Start Debugger" bookmark in Chrome, seeing the PHP output in the PHPstorm console or in the browser. So many options, a bit confusing for me. Commented Aug 13, 2014 at 21:46
  • 1) confluence.jetbrains.com/display/PhpStorm/… 2) blog.jetbrains.com/phpstorm/2013/07/… Commented Aug 13, 2014 at 22:22

1 Answer 1

1

OK for anyone who might stumble across the same problem, btw thanks, @LazyOne:

Most IDEs (Eclipse, Visual Studio, Netbeans, Xcode, IntelliJ) debugging workflow goes like that:

  1. Set a breakpoint
  2. Hit "Debug" rather than "Run"
  3. App is suspended at the breakpoint

Some IDEs even do have only a "Debug" button, no "Run", which is fine and simple enough for me.

PHPStorm is different.

You can start the App using the "Debug" button, it will launch a browser or the app in console mode, the browser plugin will even tell you that it is in debugging mode - but - breapoints won't work until you

  1. tell the IDE to listen to XDEBUG
  2. tell the App that ypu want to go into debug mode

The details of the workflow are documented in many places, a good one is in the Jetbrains manual, so just read it thoroughly and enjoy.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.