Description
Apache NetBeans version
Apache NetBeans 22
What happened
Short description
NetBeans should ignore the idekey
setting in xdebug. Currently, NetBeans by default expects idekey
to be netbeans-xdebug
. This forces to configure xdebug.idekey=netbeans-xdebug
in php.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:
The IDE Key is only important for use with the DBGp Proxy Tool, although some IDEs are incorrectly picky as to what its value is.
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 NetBeans -
If 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 the idekey
configuration in NetBeans, but make it optional.
Language / Project Type / NetBeans Component
NetBeans PHP debugging
How to reproduce
Create a simple test.php file:
<?php
print "Hello!";
?>
Set NetBeans idekey
conf to netbeans-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:
[XDebug]
xdebug.idekey = netbeans-xdebug
xdebug.mode=debug
xdebug.start_with_request=yes
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