Xdebug in v9 on OSX 10.10 not working

I am relatively new to phpStorm and have debugging working on a Macbook at home for a project.  That's on OSX 10.8.  I am now setting this up at work, on a new OSX 10.10 installation.  Everything is clean as of yesterday.  I have a MAMP installation to manage Apache/php/MySQL.

I have set up phpStorm as best I can according to the docs and my memory of what I did a few months ago at home.  However when I attempt debug a script, it just runs without stopping.  I have used the Validation tool to verify my installation.  The results are:

(i) Server Name:
(i) Loaded php.ini: /Applications/MAMP/bin/php/php5.5.26/conf/php.ini
(i) Debugger extension: Xdebug 2.2.7
(i) Remote Host: localhost (...)
(i) Remote port: 9000
(i) Remote mode: 'req' (...)

Everything seems as it should be, but it's not working.  I have installed the bookmarklets.  I was attempting a zero configuration debugging session.  The firewall on the Mac is off, for now.  I have set it to break at the beginning of each script, and have also set a breakpoint on the 2nd line.


Comment actions Permalink

Hi there,

However when I attempt debug a script, it just runs without stopping.

Is that a CLI script launched from IDE .. or a browser page?

If you are debugging a browser page -- please provide proofs that xdebug is installed and enabled -- phpinfo() output (header + xdebug-specific section)

Thing is: on Mac/Linux quite often (especially if it's a MAMP/MAMP RPO) you will have 2 differemt php.ini files: one for CLI (terminal) and one for actual Apache.

Comment actions Permalink

Hi.  It's a browser page.

My testing page is itself just a call to phpinfo().  Here's the section for xdebug:


xdebug support enabled
Version 2.2.7
IDE Key robbrandt

Supported protocols Revision
DBGp - Common DeBuGger Protocol $Revision: 1.145 $

Directive Local Value Master Value
xdebug.auto_trace Off Off
xdebug.cli_color 0 0
xdebug.collect_assignments Off Off
xdebug.collect_includes On On
xdebug.collect_params 0 0
xdebug.collect_return Off Off
xdebug.collect_vars Off Off
xdebug.coverage_enable On On
xdebug.default_enable On On
xdebug.dump.COOKIE no value no value
xdebug.dump.ENV no value no value
xdebug.dump.FILES no value no value
xdebug.dump.GET no value no value
xdebug.dump.POST no value no value
xdebug.dump.REQUEST no value no value
xdebug.dump.SERVER no value no value
xdebug.dump.SESSION no value no value
xdebug.dump_globals On On
xdebug.dump_once On On
xdebug.dump_undefined Off Off
xdebug.extended_info On On
xdebug.file_link_format no value no value
xdebug.idekey no value no value
xdebug.max_nesting_level 100 100
xdebug.overload_var_dump On On
xdebug.profiler_aggregate Off Off
xdebug.profiler_append Off Off
xdebug.profiler_enable Off Off
xdebug.profiler_enable_trigger Off Off
xdebug.profiler_output_dir /var/tmp/ /var/tmp/
xdebug.profiler_output_name cachegrind.out.%p cachegrind.out.%p
xdebug.remote_autostart Off Off
xdebug.remote_connect_back Off Off
xdebug.remote_cookie_expire_time 3600 3600
xdebug.remote_enable On On
xdebug.remote_handler dbgp dbgp
xdebug.remote_host localhost localhost
xdebug.remote_log no value no value
xdebug.remote_mode req req
xdebug.remote_port 9000 9000
xdebug.scream Off Off
xdebug.show_exception_trace Off Off
xdebug.show_local_vars Off Off
xdebug.show_mem_delta Off Off
xdebug.trace_enable_trigger Off Off
xdebug.trace_format 0 0
xdebug.trace_options 0 0
xdebug.trace_output_dir /var/tmp/ /var/tmp/
xdebug.trace_output_name trace.%c trace.%c
xdebug.var_display_max_children 128 128
xdebug.var_display_max_data 512 512
xdebug.var_display_max_depth 3 3

and what php.ini is being used:

Loaded Configuration File /Applications/MAMP/bin/php/php5.5.26/conf/php.ini
Comment actions Permalink

1) Please enable xdebug logging: http://xdebug.org/docs/all_settings#remote_log

2) Try debugging

3) Anything in the log?

4) If nothing ... place xdebug_break(); in your code (programmatic breakpoint). Anything in the log?

Basically -- I need to see the log -- only then I may tell what could be missing.

5) Where is your file is located (the path)? Does that path has symbolic link anywhere there? Thing is: xdebug works with final/resolved paths only .. so it may debug that script .. but IDE is unable to match that file to the file in a project.

6) BTW -- have you setup paths mappings for debugging. Please show screenshot of "PHP | Servers" from PhpStorm Preferences.

7) How do you debug? Do you use that "phone handle" icon (useful for zero-config approach .. or if debug is controlled/initiated from outside)?

If possible -- see if you can upgrade xdebug to the latest 2.3.x branch

Comment actions Permalink

I don't know why, but it just started working while I was trying to provide answers to the above.

The first thing I tried was to enable the log.  I did that, supplying first a full path to the MAMP logs folder and then with just a file name, and neither would generate a log file (yes, I restarted Apache and yes I searched my entire mac for the log to be sure it wasn't putting it somewhere unexpected).  Phpinfo() showed that I had made the change.

So then I started doubting that xdebug itself wasn't actually functioning, despite the results shown in phpinfo(). So I googled for some xdebug settings that would show in html output that it was working.  While doing that, I discovered a simple Xdebug debugging frontend called Codebug.  This seemed to me to be a promising fork in the road to take, since if it worked it would suggest I had a phpStorm config issue, and if it didn't it would suggest an xdebug issue, or perhaps an issue with ports being blocked or something.  In setting up Codebug, it supplied specific parameters for php.ini, namely:


I did all those things (restarting apache), but Codebug didn't work either.

So I continued with the idea of testing xdebug itself by forcing it to show debugging results in the web page itself.  I settled on analyzing var_dump output, as xdebug's default setting reformats var_dump's output.  Indeed it did!  So it seemed to me that xdebug was functioning.  However in the docs I noted that doing xdebug.overload_var_dump=2 is supposed to add more formatting, and I was curious to see that.  So I added that setting to php.ini , restarted apache and reloaded the page.....

Codebug sprung to life!  I had forgotten to turn off "listening" after I had seen it not working.  So I turned off listening in Codebug and started listening in phpStorm, and it worked too!

It makes no sense, but it's working.  I even disabled xdebug.overload_var_dump=2 and it still works.  I hate not knowing why this happened because I fear it will stop for equally unknown reasons, but at least I know it's working now.

Comment actions Permalink

Glad it works now.

You seems to perfectly know what you are doing .. so I will leave this as a note only: "xdebug.remote_autostart=1" -- with such setting xdebug will attempt to debug every single request regardless of xdebug cookie/etc and will have a delay (apprx 1 sec) when executing scripts but no debug client (e.g. IDE) is listening for debug connections.

Comment actions Permalink

Thanks for that.  I've been using IDEs for ages, starting with Zend Studio, then Aptana and then Eclipse, but all with zend_debugger.  So I am relatively new to xdebug.


Please sign in to leave a comment.