achasinh
achasinh

Reputation: 570

Xdebug suddenly not properly working on Eclipse Neon PHP Ubuntu 16

It was working properly yesterday, all I did today was installing docker, which shouldn't have anything to do with it.

The situation is that I can start debugging, but when I hit any of the "Step" (F5, F6, F7, F8) buttons it will say "PHP Applications (Waiting...)" as if it was executing code, but it will never end.

If I disable "Break at First Line" it will even go to the breakpoint, and I can evaluate any variable previous to the breakpoint, but it won't continue.

I've tried creating new projects, reinstalling xdebug and php, switching the port, uninstalling docker just in case, changing xdebug parameters in php.ini.

The thing is that the debugger works, but only until the first breakpoint.

php.ini:

zend_extension=/usr/lib/php/20151012/xdebug.so
xdebug.profiler_output_dir="/tmp/xdebug/"
xdebug.profiler_enable=off
xdebug.profiler_enable_trigger = off
xdebug.remote_enable=on
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.idekey=ECLIPSE_DBGP
xdebug.remote_connect_back=1
xdebug.show_local_vars=0
xdebug.max_nesting_level=400

Some of the variables I added for testing, with no success.

phpinfo()

phpinfo()

Upvotes: 0

Views: 265

Answers (1)

achasinh
achasinh

Reputation: 570

Finally I had some time to play with configurations, after reinstalling xdebug for php7, trying different rules in /etc/php/7.0/cli/conf.d/20-xdebug.ini, I read in a github project issues thread:

I solved by remove all Watch Variables.

And I thought, "it cannot be that", but gave it a chance, and it did it. Maybe playing with the .ini file helped, but what made it work at last was removing all the expressions in eclipse debug window.

Here is the git issue thread (the project is a PHP Debug Adapter for Visual Studio that has nothing to do with my environment): https://github.com/felixfbecker/vscode-php-debug/issues/205

Anyway here is the 20-xdebug.ini configuration that is working for me:

zend_extension="/usr/lib/php/20160303/xdebug.so"
xdebug.remote_autostart=on
xdebug.remote_enable = On
xdebug.remote_port = 9000
xdebug.remote_host = 127.0.0.1
xdebug.show_error_trace = 1
xdebug.remote_handler="dbgp"

Upvotes: 0

Related Questions