Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

idekey xdebug setting is not ignored #7562

Open
rsanzante opened this issue Jul 11, 2024 · 0 comments
Open

idekey xdebug setting is not ignored #7562

rsanzante opened this issue Jul 11, 2024 · 0 comments
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)

Comments

@rsanzante
Copy link

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):

image

This setting is even encouraged in the dialogo NetBeans displays when a debugging session fails to start:

image

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):

image

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. 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

@rsanzante rsanzante added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Jul 11, 2024
@troizet troizet added PHP [ci] enable extra PHP tests (php/php.editor) debugger labels Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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)
Projects
None yet
Development

No branches or pull requests

2 participants