1 Replies Last post: Feb 20, 2013 6:49 PM by Andriy Bazanov  
Lars Nielsen Newbie 1 posts since
Feb 20, 2013
Currently Being Moderated

Feb 20, 2013 6:22 PM

Breakpoints not firing with XDebug

I just started out using PHP storm and am not that familiar with Apache so bear with me.  I am using Instant Wordpress to develop Wordpress sites on my desktop.  Instant Wordpress comes with MySQL and Apache built in so you just start it up and it creates a Wordpress instance at http://127.0.0.1:4001/wordpress.  I am using PHP Storm to edit the files in my custom theme folder in the Wordpress installation.  I'm trying to get XDebug to work for debugging. 

 

The XDebug DLL is already installed in a subfolder of the PHP folder and I have changed my PHP.INI file so that then I run a phpinfo() command in a test PHP file, it is reporting that XDebug is set up.  This is what I have in my php.ini file:

 

[XDebug]

zend_extension="C:\Development\iwp43dwmh\iwpserver\server\php\ext\php_xdebug.dll"

xdebug.remote_enable=1

xdebug.remote_port="9000"

xdebug.profiler_enable=1

xdebug.remote_host = "http://127.0.0.1:4001"

xdebug.profiler_output_dir="C:\Development\iwp43dwmh\iwpserver\server\php\tmp"

xdebug.remote_log="C:\temp\xdebug_log.txt"

 

I have set up the Server in PHP Storm to point to 127.0.0.1 port 4001 and created a Run configuration in  PHP Storm, called IWP, using PHP Web Application.  I have hooked the run configuration in to the server which I have already set up.  I have attached screenshots of my Project settings - Servers and Deployment Mapping tab.  Also my run configuration setting.

 

When I click Run - Debug IWP the browser fires up and goes to the URL:

 

http://127.0.0.1:4001/wordpress/?XDEBUG_SESSION_START={large number}

 

I can see a new debugging session starts up in PHP Storm.  However any breakpoints that I set in the PHP files are not hit.  I also tried ticking "break at first line in PHP scripts" but that also doesn't seem to hit anything.  Can anyone tell me what might be wrong or where to look?  Thanks

Attachments:
Andriy Bazanov Master 4,157 posts since
May 28, 2010
Currently Being Moderated
Feb 20, 2013 6:49 PM in response to: Lars Nielsen
Re: Breakpoints not firing with XDebug

Hi Lars,

 

Few mistakes/notes:

 

1)

 

xdebug.remote_host = "http://127.0.0.1:4001"

The "http://127.0.0.1:4001" part is wrong -- should be just IP (127.0.0.1) or host name (localhost)

 

2) NOTE: Debugging and profiling at the same time does not make much sense -- you should really use only 1 of them at the same time (when debugging, script may execute 10/100/1000 times longer than normally, therefore profiling in such case will mean nothing)

 

3) NOTE: Deployment settings/mappings have nothing to do with debugging

 

4) Settings | PHP | Servers (your Server.png image) -- the data in "Absolute path on the server" is wrong:

  a) you are executing PHP on local server, therefore there should be Windows paths

  b) most likely you do not need to setup any mapping at all since you are executing it on the same computer and OS where PhpStorm is installed (unless, of course, you are using symbolic links in those paths)

 

My suggestion:

1) Untick "Use path mapping..." on that server settings page and try to debug

2) If that does not help:

  a) Delete such entry completely

  b) Delete that Run/Debug Configuration

  c) Activate "Run | Start Listen PHP Debug Connections"

  d) In browser, navigate to the website

  e) Using bookmarklets, (Start Debugger one), activate debug session (set debug cookie) and reload the page

  f) PhpStorm should show you popup window asking for path mapping (assuming that you have breakpoint setup already) -- point to correct location. It should create entry in "Settings | PHP | Servers" with correct mappings (you can compare it later to what you had)

 

Check this link for some articles, in particular Zero-Configuration debugging with PhpStorm 2.0 (in case you have not seen it yet)

 

Let me know how you are doing.

More Like This

  • Retrieving data ...