PHP remote debugging: XDebug cannot connect to JetBrains php Storm client

I like it when remote debugging works with the following software configuration:

Win 7 Pro 64bit WAMP Server 2.2 (32 bit), incl. Apache 2.2.22, PHP 5.4.3, XDebug php_xdebug-2.2.1-5.4-vc9.dll JetBrains PHPStorm 4.0.3

1.) WAMP is up and running, my site can be found under localhost / fox /

2.) PHP Storm has a project in which there is a mapping between my source files and the apache localhost / fox alias

2.) I installed the PHP XDebug extension and added the following lines to my php.ini

[xdebug] zend_extension="c:/wamp/bin/php/php5.4.3/zend_ext/php_xdebug-2.2.1-5.4-vc9.dll" xdebug.remote_enable=On xdebug.remote_host="localhost" xdebug.remote_port=9000 xdebug.remote_connect_back=On xdebug.remote_autostart=On xdebug.profiler_enable=On xdebug.profiler_enable_trigger=off xdebug.profiler_output_name=cachegrind.out.%t.%p xdebug.profiler_output_dir="c:/wamp/tmp" xdebug.remote_log="C:/wamp/tmp/xdebug.log" xdebug.remote_cookie_expire_time=6000 

To do this, you must configure the XDebug remote debugger and the feedback address.

I already installed my installation here: xdebug.org/wizard.php

3.) I configured phpstorm, first I added a local server

and then checked my settings here

http://www.bilder-hochladen.net/files/jrn0-2-c81e-jpg-nb.html

(I tried 127.0.0.1/fox as the server address, and localhost instead)

hier my debug settings: http://www.bilder-hochladen.net/files/jrn0-1-c4ca-jpg.html

Now I restart my apache, I enter phpstorm, set a breakpoint (red), click the function

 Run -> Start listen to PHP Debug Connections 

The handset tans to green, whatever it is, but it is a positive signal for me.

When I now run my php Script on the local absolutley web server, nothing happens, the program works on the breakpoint and does not stop.

In the Xdebuggers log (C: /wamp/tmp/xdebug.log) I find loads of messages like these:

  I: Checking remote connect back address. I: Remote address found, connecting to ::1:9000. E: Could not connect to client. :-( Log closed at 2012-07-19 14:21:08 

Somewhere on the Internet, I found a hint that the Windows Firewall could block the connection, so I turned it off, but that didn't help.

I also tried connecting via telnet to localhost: 9000, and I got a response from phpstorm.

Does anyone have an idea where to look for a bug or what else could I try to get this stuff to work?

Thanks so much for your help in advance, Michael

ps Sorry, I am not allowed to post more than two links, because I'm new here, so there is no hyperlink to the xdebug master.

+19
php phpstorm xdebug apache2 remote-debugging
Jul 19 2018-12-12T00:
source share
4 answers

Maybe a little late, but ...

Here you have a conflict with your settings:

 xdebug.remote_host="localhost" xdebug.remote_connect_back=On 

These two settings overlap. What is your case?

a) You want to debug the application from only one source (for example, you develop and deploy to localhost ).

Then you are almost done: you have already determined that the remote host is localhost . Comment out the line remote_connect_back (c ; )

b) You want to accept several development sources (for example, several machines are debugging an application on the same network).

Then the remote_host line remote_host redefined, so you can delete or comment on it.

This is actually the configuration you are currently performing. So what's wrong with that? Check if this script works:

 <? echo $_SERVER['REMOTE_ADDR']; 

The output will be ::1 . Well, the host making the request to your Apache server, localhost . And Apache resolves this name as the IPv6 address ::1 , which in the end is not mistaken. But Xdebug cannot connect to the IPv6 address. Cm:

 I: Remote address found, connecting to ::1:9000. E: Could not connect to client. :-( 

Therefore, our goal will be to allow Apache to allow localhost preferably to an IPv4 address (without disabling IPv6 support at the OS or Apache level). This can be achieved by adding the following line to your hosts :

 127.0.0.1 localhost 

This simple hack will do the trick! Now localhost will always be resolved as an IPv4 address, and ::1 will still be understood.

+12
Dec 04 '13 at 2:22
source share

You can try disabling IPV6 http://support.microsoft.com/kb/929852 , I think this is a problem when you try to connect.

The remote address was found by connecting to :: 1: 9000.

The system is trying to connect to IPV6, and I think XDebug is only enabled for IPV4.

+6
Jul 25 2018-12-18T00:
source share

Where exactly is your breakpoint in your code? I know XDebug can be fun.

For PHP 5.4, your Xdebug settings should be

 [XDebug] zend_extension="<path to php_xdebug.dll>" xdebug.remote_enable=1 xdebug.remote_port="<the port for XDebug to listen to>" (the default port is 9000) xdebug.profiler_enable=1 xdebug.profiler_output_dir="<AMP home\tmp>" 

http://www.jetbrains.com/phpstorm/webhelp/configuring-xdebug.html

0
Mar 10 '13 at 15:10
source share

If you use chrome, install the following plugin: https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc after installing the installation of your IDE key in both the plugin and phpstorm

I managed to run it with only these two additional lines in the php.ini file:

 [XDebug] ;; Only Zend OR (!) XDebug zend_extension = C:\php\ext\php_xdebug-2.2.1-5.3-vc9.dll xdebug.remote_enable=true 

Each time you want to debug, you start by turning on "debugging, profiling and tracing" in this plugin, and then you run your code in debug mode from phpstorm. Make sure your project settings in phpstorm are correct.

0
Mar 10 '13 at 17:54
source share



All Articles