OSX Connection was not established Xdebug extension is installed. Check configuration options.

A few things have happened:

PhpStorm updated to lates version: 2019.2.2

OSX php version was updated to 7.2.22

xdebug was updated to 2.7.*

MAMP PRO updated to 5.5

After that xdebug fail to stop at breakpoints when I've tried to debug local projects (simple php files, unit test etc.)

I've tried to downgrade xdebug to version 2.6.1. Same error. I've tried to run xdebug with MAMP interpreter - same issue.

Message from phpstorm:

"Connection was not established. 'Xdebug 2.5.1.' extension is installed. Check configuration options.

php -v

PHP 7.2.22 (cli) (built: Sep 14 2019 18:36:32) ( NTS )

Copyright (c) 1997-2018 The PHP Group

Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

with Xdebug v2.6.1, Copyright (c) 2002-2018, by Derick Rethans

with Zend OPcache v7.2.22, Copyright (c) 1999-2018, by Zend Technologies

xdebug data from php ini file

xdebug

 

xdebug support => enabled

Version => 2.6.1

IDE Key => PHPSTORM

 

Supported protocols

DBGp - Common DeBuGger Protocol

 

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.filename_format => no value => no value

xdebug.force_display_errors => Off => Off

xdebug.force_error_reporting => 0 => 0

xdebug.gc_stats_enable => Off => Off

xdebug.gc_stats_output_dir => /var/tmp/ => /var/tmp/

xdebug.gc_stats_output_name => gcstats.%p => gcstats.%p

xdebug.halt_level => 0 => 0

xdebug.idekey => PHPSTORM => PHPSTORM

xdebug.max_nesting_level => 256 => 256

xdebug.max_stack_frames => -1 => -1

xdebug.overload_var_dump => 2 => 2

xdebug.profiler_aggregate => Off => Off

xdebug.profiler_append => Off => Off

xdebug.profiler_enable => Off => Off

xdebug.profiler_enable_trigger => Off => Off

xdebug.profiler_enable_trigger_value => no value => no value

xdebug.profiler_output_dir => /var/tmp/ => /var/tmp/

xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p

xdebug.remote_addr_header => no value => no value

xdebug.remote_autostart => On => On

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.remote_timeout => 200 => 200

xdebug.scream => Off => Off

xdebug.show_error_trace => 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_enable_trigger_value => no value => no value

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

 

interpreter configuration screenshot

 

5 comments
Comment actions Permalink

Hi there,

Please change Xdebug port to be 9001 (in both php.ini and PhpStorm). Restart web server mey be needed for new php.ini settings to be applied.

Right now Xdebug successfully connects to some other service that is perfectly aware what Xdebug is.

Based on the fact that you are on Mac -- it most likely going to be php-fpm that uses the same TCP 9000 port by default. You can verify what service listens on that port via "sudo lsof -nP -iTCP -sTCP:LISTEN" command or alike (e.g. netstat)

4
Comment actions Permalink

I've changed port to 9001 both in php.ini and phpstorm config.

Now xdebug works fine!

Thanks for your help!

3
Comment actions Permalink

Hi there,

Enable and collect Xdebug log. Then check what it says -- may give clues (if Xdebug even tries to connect anywhere, if it does -- where and what response it may have etc)

0
Comment actions Permalink

I've added the bellow line in php.ini

xdebug.remote_log = "/Users/Andrew/tmp/xdebug.log"

Other options are the same

MAMP php 7.2.21 interpreter xdebug log is bellow:

[5425] Log opened at 2019-09-25 11:03:19

[5425] I: Connecting to configured address/port: 127.0.0.1:9000.

[5425] I: Connected to client. :-)

[5425] -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///Users/Andrew/..FILEPATH... /Tasks/debugtest.php" language="PHP" xdebug:language_version="7.2.21" protocol_version="1.0" appid="5425" idekey="15497"><engine version="2.7.2"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2019 by Derick Rethans]]></copyright></init>

[5425]

[5425] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>

[5425]

[5425] Log closed at 2019-09-25 11:03:19

[5425]

Bower php 7.2.22 interpreter xdebug log is bellow:

Log opened at 2019-09-25 11:07:20

I: Connecting to configured address/port: 127.0.0.1:9000.

I: Connected to client. :-)

-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///Users/Andrew/..FILEPATH... /Tasks/debugtest.php" language="PHP" xdebug:language_version="7.2.22" protocol_version="1.0" appid="5458" idekey="15790"><engine version="2.6.1"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2018 by Derick Rethans]]></copyright></init>

-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>

Log closed at 2019-09-25 11:07:20

Seems that there are no errors and warning in log file, but it still doesn't work...

0
Comment actions Permalink

Port 9001 also worked for me today (April 29th, 2022)

Thanks a lot...

 

0

Please sign in to leave a comment.