PHPUnit 'Debug connection was not established'

from issue tracker:

Tom Maguire

Hi there,
I'm currently trying to set up PHPStorm 2.0 v103.99 to  debug unit tests using PHPUnit. I can run all the tests fine, however  when I run them in debug mode, I get a message informing me that 'Debug  connection was not established', and it does not hit any of the break  points.
I am using xdebug, which works fine when I am debugging in a  browser, but cannot seem to connect when running the tests through the  PHPStorm console.
Any help would be much appreciated, please let me know if I need to supply more information.
Thanks

0
4 comments
Avatar
Permanently deleted user

Hello Tom,

This message means that you have a problem with debugger settings. Please check your settings with - http://xdebug.org/find-binary.php.  Thank you for feedback!

0
Avatar
Permanently deleted user

Hi Nikolay, thanks for your reply.

Here is the output from the site (all seems fine?):

Summary

  • Xdebug installed: 2.1.0
  • Server API: Apache 2.0 Handler
  • Windows: no
  • Zend Server: no
  • PHP Version: 5.3.3-1
  • Zend API nr: 220090626
  • PHP API nr: 20090626
  • Debug Build: no
  • Thread Safe Build: no
  • Configuration File Path: /etc/php5/apache2
  • Configuration File: /etc/php5/apache2/php.ini
  • Extensions directory: /usr/lib/php5/20090626+lfs



  • And here is the info from php_info():

    xdebug support enabled
    Version 2.1.0

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

    Directive Local Value Master Value
    xdebug.auto_trace Off Off
    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.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.manual_url http://www.php.net http://www.php.net
    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 /tmp/xdebug/ /tmp/xdebug/
    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_format 0 0
    xdebug.trace_options 0 0
    xdebug.trace_output_dir /tmp /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



    If you have any other suggestions they'd be much appricaited

    Thanks
    Tom

    0
    Avatar
    Permanently deleted user

    Tom,

    It is configuration of php installed on apache. The path to php.ini for CLI is usually something like '/etc/php5/cli/php.ini'. Please ensure that you check the proper configuration.

    Also check 'Debugger' field value in PHP settings. It is should be 'Xdebug' selected.

    debugger.png

    0
    Avatar
    Permanently deleted user

    Aha! That did the trick. Thank you very much

    0

    Please sign in to leave a comment.