idekey xdebug setting is not ignored #7562
Labels
debugger
kind:bug
Bug report or fix
needs:triage
Requires attention from one of the committers
PHP
[ci] enable extra PHP tests (php/php.editor)
Apache NetBeans version
Apache NetBeans 22
What happened
Short description
NetBeans should ignore the
idekey
setting in xdebug. Currently, NetBeans by default expectsidekey
to benetbeans-xdebug
. This forces to configurexdebug.idekey=netbeans-xdebug
inphp.ini
to make debugging work in NetBeans.Although it seems this was fixed in https://issues.apache.org/jira/browse/NETBEANS-5905 the problem is still present.
Details
Quote from Xdebug documentation about the idekey setting:
However, NetBeans expects the idekey value to match the value configured in PHP's Debugging section (by default is netbeans-xdebug):
This setting is even encouraged in the dialogo NetBeans displays when a debugging session fails to start:
In NetBeans code there are several references to this ideky setting, see https://github.com/search?q=repo%3Aapache%2Fnetbeans+idekey&type=code
Also, it is not possible to set
idekey
to empty string (that may mean don't take it into account when receiving xdebug connections):Proposed solution
There two solutions
Completely remove the
idekey
handling in NetBeansIf this setting is still relevant make it optional, so for example if the setting in NetBeans is empty it is not taken into account when receiving xdebug connections.
Also, I would update NetBeans docs on debugging. Because Xdebug docs says idekey is not relevant for IDEs and only to be used with DBGp Proxy Tool, I think it would be important to explain why NetBeans may need this.
As far as I know, the
idekey
may be required only in a very specific scenario (when multiple users are debugging PHP applications remotely through the DBG Proxy Tool), so it may be good to keep theidekey
configuration in NetBeans, but make it optional.Language / Project Type / NetBeans Component
NetBeans PHP debugging
How to reproduce
Create a simple test.php file:
Set NetBeans
idekey
conf tonetbeans-xdebug
if not already set.Enable XDebug 3.x module in your PHP engine and configure the debug extension adding this to the php.ini file:
Open the file's folder with NetBeans, and try to debug the code. XDebug should successfully connect to NetBeans.
Then, remove the following line from your
php.ini
file:xdebug.idekey = netbeans-xdebug
Try to start a debugging session, this time XDebug can't connect to NetBeans and session is never started.
Did this work correctly in an earlier version?
No / Don't know
Operating System
Linux (but it is not OS related)
JDK
21 (but not JDK related)
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
No response
Are you willing to submit a pull request?
No
The text was updated successfully, but these errors were encountered: