How to set PHPStorm to use IPV6 with xDebug

Hi,

The OS of my computer is the last release of Windows 10.

I would like to use xDebug with PHPStorm, z-Wamp and Firefox.

xDebug is defined like this in PHP.Ini:
[XDebug]
xdebug.idekey=PHPSTORM
xdebug.default_enable=on
xdebug.remote_enable=on
xdebug.remote_host=localhost
xdebug.remote_port=9001
xdebug.remote_connect_back=on
xdebug.remote_autostart=on
xdebug.remote_log=indicate a local xdebug.log file

The settings about xDebug are the following:
Language & Frameworks/PHP/Debug/Debug port: 9001
Language & Frameworks/PHP/Debug/DBGp proxy/IDE key: PHPSTORM
Language & Frameworks/PHP/Debug/DBGp proxy/Host: localhost
Language & Frameworks/PHP/Debug/DBGp proxy/Port: 9001

I defined a configuration as following:
PHP Web page/Server: my server
my server/Host: localhost
my server/Port: 80
my server/Debugger: Xdebug I have this:

I also installed xDebug Ext on Firefox.

Then in PHPStorm I click on the button to start listening for PHP Debug Connections I have this:

When I run netstat -anob -p tcp
TCP   0.0.0.0:9001           0.0.0.0:0             LISTENING       XXXXX
[phpstorm64.exe]

When I run netstat -anob -p tcpv6
there is no line with phpstorm64.exe

When to debug I make sure xDebug Ext is enabled and when I refresh the page I have this from xDebug:
Log opened at YYYY-YY-YY YY:YY:YY
I: Checking remote connect back address.
I: Remote address found, connecting to ::1:9001.
E: Could not connect to client. :-(
Log closed at ZZZZ-ZZ-ZZ ZZ:ZZ:ZZ

How to make PHPStorm listen to IPV6 rather that IPV4?

Regards,

Bertrand

0
4 comments

You don't have IPv4 preference in your logs, do you?
https://youtrack.jetbrains.com/issue/WI-30173#focus=streamItem-27-1444510.0-0
For me, PhpStorm is listening on IPv6 as well: http://prntscr.com/r1ezlm

0

Hi,

Thank you.

As it is proposed in the link you provided, I removed the line -Djava.net.preferIPv4Stack=true from bin/phpstorm64.vmoptions.
For information, I did this as it is recommanded here: Configuring-JVM-options-and-platform-properties.
I have the confirmation with netstat and telnet that PHPStorm is using IPV6.

Infortunately, there is a bug in PHPStorm, and xDebug is still not useble, but that is another story.

Regards,

Bertrand.

0

Infortunately, there is a bug in PHPStorm, and xDebug is still not useble, but that is another story.

Is it something we already know about? Please share a link to the issue if it is, otherwise, please describe the bug in a bit more detail. Thank you!

0

I haven't noticed, but z-Wamp is neither more maintained. Also, I was working with an old version of xDebug.

I don’t know if the exception I found is one that is known, but I read in different requests that using a most recent version of xDebug was solving the problem.

I decide to change the Windows web development environment, and I am know using WAMP. Also, all the problems are solved, and I can work with PHPStorm as I want.

As the bug is for an old version of xDebug, I am not sure it is interesting to spend time to find what is wrong. However, here is the information I was able to gather:

2020-02-13 00:13:06,835 [ 469382]   WARN - il.connection.ServerConnection - input stream is finished
java.io.IOException: input stream is finished
             at com.jetbrains.php.debug.xdebug.dbgp.DbgpUtil.readDocument(DbgpUtil.java:115)
             at com.jetbrains.php.debug.xdebug.dbgp.DbgpUtil.readMessage(DbgpUtil.java:283)
             at com.jetbrains.php.debug.xdebug.connection.XdebugConnection$MyInputReader.read(XdebugConnection.java:135)
             at com.jetbrains.php.debug.xdebug.connection.XdebugConnection$MyInputReader.read(XdebugConnection.java:124)
             at com.jetbrains.php.debug.xdebug.connection.XdebugConnection.init(XdebugConnection.java:47)
             at com.jetbrains.php.debug.connection.PhpDebugServer.handle(PhpDebugServer.java:51)
             at com.jetbrains.php.debug.connection.PhpDebugServer.handle(PhpDebugServer.java:34)
             at com.jetbrains.php.util.connection.ServerConnection.lambda$null$0(ServerConnection.java:64)
             at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:238)
             at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
             at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
             at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
             at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
             at java.base/java.lang.Thread.run(Thread.java:834)
2020-02-13 00:13:10,403 [ 472950]   INFO - il.connection.ServerConnection - Stopped listening on port 9001
2020-02-13 00:13:10,403 [ 472950]   INFO - il.connection.ServerConnection - Stopped listening on port 10137
2020-02-13 00:13:10,404 [ 472951]   INFO - il.connection.ServerConnection - Stopped listening on port 20080
0

Please sign in to leave a comment.