Skip to content
Advertisement

Cannot step xdebug with NetBeans since php 8

Since upgrading from php 7 to php 8, I can no longer Step Into/Step Over/Continue with NetBeans IDE 11.0 and xdebug 3.0.4.

xdebug (via NetBeans) is configured to “Stop at First Line” – and this works. That is, the (local host) web page is suspended, and the NetBeans Step Into/Step Over/Continue buttons are enabled. But, when I click any of Step Into/Step Over/Continue, the xdebug session is closed, and NetBeans no longer prompts. Additionally, the web page completes – but without any output.

There’s nothing related in syslog. The php8.0-fpm.log shows no errors. The xdebug.log file is below.

Is there any other log I should be looking at?

JavaScript

Advertisement

Answer

There are some changes between PHP 7.4 and 8.0, which change the behaviour of error checking for internal eval statements, which Xdebug uses when an IDE sets a watch.

If I base64 decode your (or rather the IDE’s) eval statement (eval -i 43 -- KFxnZXRfb3B0aW9uKHNlbGY6OiRTRVRUSU5HU19OQU1FKQ==), it says:

JavaScript

There is an extra ( at the start, most likely in a watch that you’ve set?

Xdebug 3.1 should have a fix for the changes to eval, and you can test this for yourself by installing Xdebug 3.1.0beta2, from either PECL (pecl install xdebug-3.1.0beta2) or from source code.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement