XDebug not working anymore

Answered

Hello,

The debugging is not working anymore on any of my project, when I start listening to incoming connection the script is blocked until I stop to listen to connections, even if I have no breakpoints on my code. And when I put a breakpoint on the first line (it's not working on others lines), the script is indeed stopped, but when I tell him to go to next line it block again (even with the simplest code possible).

I tried to check the debug configuration everything is ok (I used the validator from phpstorm), the path mapping is also ok, well last week everything worked fine and I changed nothing so ...

Here is my configuration on my php.ini :

xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_log=[path]/xdebug.log
xdebug.idekey=PHPSTORM

And here are some part of my xdebug.log when i put a breakpoint on first line then do a step over :

[4605] Log opened at 2019-03-12 14:13:50
[4605] I: Connecting to configured address/port: 127.0.0.1:9000.
[4605] I: Connected to client. :-)
[...]
[4605] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="19" context="1"><property name="$_COOKIE" fullname="$_COOKIE" type="array" [...] </property></response>
[...]
[4605] <- step_over -i 21
[4605] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_over" transaction_id="21" status="break" reason="ok"><xdebug:message filename="file:///[path]" lineno="4"></xdebug:message></response>
[4605]

The first response is when it stopped on the breakpoint on the first line, I have everything working fine with variables as "$_COOKIE" logged, then I do the step over, and the script is like stuck. And the problem can't be in the code, I tried with a script with only 2 "echo". I tried to restart apache, I tried to restart phpstorm, and I tried to restart my computer, nothing changed.

 

My phpstorm version :

PhpStorm 2018.1
Build #PS-181.4203.565, built on March 28, 2018
You have a perpetual fallback license for this version
Subscription is active until November 24, 2019
JRE: 1.8.0_152-release-1136-b20 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.4.0-102-generic

My php version :

PHP 7.1.27-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Mar 7 2019 20:02:03) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.1.27-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.7.0, Copyright (c) 2002-2019, by Derick Rethans

Do you have any idea of what is hapening ? (it seems my php version was built last week, maybe it's linked ...)

5 comments
Comment actions Permalink

If someone else have the same problem, xdebug 2.7.0 is not working with phpstorm 2018.1, you need either upgrade phpstorm or downgrade xdebug. I upgraded phpstorm to the version 2018.3 and now everything is fine.

3
Comment actions Permalink

Thanks for sharing!

0
Comment actions Permalink

Thanks Yrtiop!

0
Comment actions Permalink

I thought I was the only one!

Problem is, I'm using PHP 7.3 for which you need xdebug 2.7. So updating (ie purchasing) to a new version of PhpStorm is the solution if you want to use php 7.3.

0
Comment actions Permalink

You are amazing! Indeed, xDebug  versions > 2.6 don't properly work in the PhpStorm 2018.1 or 2018.2 versions. Had the same problem when upgrading Laravel Homestead - maybe some guide for people that ran in the same problem:

Switch your box default php version to 7.1 (optional):
sudo update-alternatives --set php /usr/bin/php7.1

Run the following command to enable xDebug (enable xDebug in all PHP versions):
xon

You have to set this configuration manually for the project PHP version you are using - in this case, PHP 7.1 (/etc/php/7.1/fpm/conf.d/20-xdebug.ini):
zend_extension=xdebug.so
xdebug.remote_enable = 1
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.max_nesting_level = 512
xdebug.remote_log=/home/vagrant/code/xdebug.log

Restart you NGINX (for the kicks) and php-fpm:
sudo service php7.1-fpm restart
sudo service nginx restart

0

Please sign in to leave a comment.