2
votes

Yesterday debugger stopped working without any reason. I use PhpStorm IDE to debug. I put breakpoint at start of page and it doesn't stop on it.

I tried to debug console script with same PHP version and it works fine - debugging stoped on breakpoint. I changed php version on Apache server and tried degguning on another project - it works fine, debugging stops on breakpoint.

PHP Version 5.6.40-12+ubuntu18.04.1+deb.sury.org+1

/etc/php/5.6/apache2/conf.d/20-xdebug.ini

zend_extension=xdebug.so
xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.scream=0
xdebug.show_local_vars=1
xdebug.idekey=PHPSTORM
xdebug.remote_enable=1
xdebug.remote_log='/val/log/xdebug.log'

**xdebug version**: 2.5.5xdebug_config_1

xdebug_config_2

PhpStorm 2019.2.3 Build #PS-192.6817.20, built on September 25, 2019 Runtime version: 11.0.4+10-b304.69 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Linux 5.0.0-27-generic

While debugging start, PhpStorm log has warning. Maybe this helps:

2019-10-07 15:51:33,188 [25325256]   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:294)
    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)

How to fix problem, how to force xdebug stops on breakpoints?

1
Would you mind providing additional details on phpinfo xdebug section? lower part, where xdebug.remote_port, xdebug.remote_enable, etc values are displayed. And what about environment: do you run your php site in vagrant, docker, or locally? - Yerke
@Yerke, screens added. Site stays locally, runs using apache2 - Oleg

1 Answers

4
votes

From the error message I can see that the debugging session does work. PhpStorm seems to abort the connection.

It's likely that Xdebug is sending XML that PhpStorm does not understand (i.e., it's invalid). I suspect it's either due to a null character in a property name or array key name. (Feel free to post the full log to a pastebin, I'm happy to look and amend the answer).

You are already creating a remote log file, so have a look at the last few lines that are in there, just after your debugging session aborts.

You can fix this issue by upgrading Xdebug to a supported version (2.7.2 at the moment).