idekey xdebug setting is not ignored
- Dominant language
- Java
- Stars
- 3.1k
- Forks
- 935
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 17
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](https://xdebug.org/docs/all_settings#idekey) setting:
> The IDE Key is only important for use with the [DBGp Proxy Tool](https://xdebug.org/docs/dbgpProxy), 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
1) Completely remove the `idekey` handling in NetBeans
2) 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](https://netbeans.apache.org/tutorial/main/kb/docs/php/debugging/). Because Xdebug docs says idekey is not relevant for IDEs and only to be used with [DBGp Proxy Tool](https://xdebug.org/docs/dbgpProxy), 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:
```
```
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
Contributor guide
Research direction
Start by searching the NetBeans PHP debugging code for the several idekey references mentioned in the issue, then compare that handling with the Xdebug 3.x reproduction steps. Decide whether idekey should be removed or made optional, and update the PHP debugging documentation if needed. Done means debugging connects without requiring xdebug.idekey, with the chosen behavior documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100