等待连接到XDEBUG的Netbeans。

时间:2023-01-18 08:35:24

Netbeans won't connect to xdebug. I've tried suggestions from the following posts:

Netbeans不会连接到xdebug。我尝试了以下的建议:

Debugging IDE's port connection to XDebug: "Waiting to Connect"

调试IDE的端口连接到XDebug:“等待连接”

netbeans shows "Waiting For Connection (netbeans-xdebug)"

netbeans显示“等待连接(netbeans-xdebug)”

but it doesn't fix my issue.

但这并不能解决我的问题。

It seems Netbeans connects to xdebug because while it waits for the connection all request made to the webserver [Apache2] are blocked. Also the port [9001] appears to be in use:

似乎Netbeans连接到xdebug,因为当它等待连接时,对webserver [Apache2]的所有请求都被阻塞。同时,港口[9001]似乎正在使用:

roxy@Pixy011 ~ $ sudo nmap -sS -O 127.0.0.1

Starting Nmap 6.00 ( http://nmap.org ) at 2013-11-28 20:48 EST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000029s latency).
Not shown: 990 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
139/tcp  open  netbios-ssn
443/tcp  open  https
445/tcp  open  microsoft-ds
631/tcp  open  ipp
902/tcp  open  iss-realsecure
3306/tcp open  mysql
8080/tcp open  http-proxy
8081/tcp open  blackice-icecap
9001/tcp open  tor-orport   <---- Opened by java

xdebug.ini: [I have confirmed it is loaded in phpinfo()]

xdebug。ini:[我已经确认它被载入phpinfo()]

zend_extension=/usr/lib/php5/20100525/xdebug.so

xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_mode="req"
xdebug.remote_host="127.0.0.1"
xdebug.remote_port=9001
xdebug.idekey="netbeans-xdebug"

Netbeans configuration:

Netbeans配置:

Debugger port: 9001
Session ID: netbeans-xdebug
Stop at first line: Checked
All other options are unchecked

Project properties:

项目属性:

Host: 127.0.0.1
Port: 9001

Edit: I've noticed Netbeans doesn't append the XDEBUG_SESSION_STOP to the URL. I don't think this is related to the issue because Netbeans only opens the page after I close the debugging session.

编辑:我注意到Netbeans没有将XDEBUG_SESSION_STOP附加到URL。我不认为这与这个问题有关,因为Netbeans只在我关闭调试会话后打开页面。

I've also disabled SELinux

我也禁用SELinux

5 个解决方案

#1


25  

On Ubuntu 13.04 64bit php 5.4.9-4 Xdebug v2.2.3 netbeans 7.4
I have same problem and have solve it by:
1. go on http://xdebug.org/wizard.php follow the instructions to compile your own xdebug.so
2. in netbean 7.4 general options (sorry I haven't reputation 10 to post image) test connection. be sure correct settings on Proxy: to me "No Proxy" is working.
3. in php options debugging tab change xdebug setting port to other than 9001 or 9000. I choose 9002 but you can try until you find a free port (if port is not free nb tell you)
4. in php.ini OR for ubuntu users in /etc/php5/conf.d/20-xdebug.ini

在Ubuntu 13.04 64bit php 5.4.9-4 Xdebug v2.2.3 netbeans 7.4我有同样的问题,并且已经解决了:1。请按照以下说明编译您自己的xdebug。所以2。在netbean 7.4通用选项(抱歉,我没有把图片的图片)测试连接。在代理上确定正确的设置:对我来说“没有代理”是有效的。3所示。在php选项中,调试选项卡将xdebug设置端口更改为9001或9000。我选择9002,但你可以尝试直到你找到一个免费的港口(如果港口不是免费的nb告诉你)4。在php中。ini或ubuntu用户在/etc/php5/conf.d/20-xdebug.ini。

zend_extension=/usr/lib/php5/20100525/xdebug.so #where you ave put your reconpiled xdebug.so
[xdebug]
xdebug.remote_autostart=0
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_mode="req"
xdebug.remote_port=9002 # the port you have found free and set in netbeans above
xdebug.remote_host=127.0.0.1
xdebug.profiler_enable=0
xdebug.profiler_output_dir="/tmp/"
xdebug.idekey="netbeans-xdebug"
xdebug.remote_log="/home/#user_name#/xdebug.log" #your user name

zend_extension = / usr / lib / php5/20100525 / xdebug。所以,你要把你的reconstack xdebug放在哪里。所以xdebug xdebug。xdebug remote_autostart = 0。xdebug remote_enable = 1。xdebug remote_handler = " dbgp”。remote_mode = xdebug“要求”。remote_port=9002 #端口,您在xdebug.remote_host=127.0.0.1 xdebug中找到了空闲的并在netbeans中设置的端口。xdebug profiler_enable = 0。xdebug profiler_output_dir = " / tmp /”。idekey = " netbeans-xdebug " xdebug.remote_log = " / home / # user_name # / xdebug。日志“#你的用户名

5. sudo service apache2 restart

5。输入sudo服务重启

after do this I can debug php again.

这样做之后,我可以再次调试php。

#2


0  

Had same issue:

有同样的问题:

$ netstat | grep 9000
...
tcp6       1      0 localhost:9000          localhost:37486         CLOSE_WAIT

Solution: Restart NetBeans. There was running a dead Process waiting for connections.

解决方案:重新启动NetBeans。正在运行一个等待连接的死进程。

Here Netbeans with a running debug session. Note the CLOSE_WAIT and TIME_WAIT.

这里是运行调试会话的Netbeans。注意CLOSE_WAIT和TIME_WAIT。

tcp6       0      0 localhost:9000          localhost:38166         TIME_WAIT 

#3


0  

I had the same issue and I have tried many solution i had found out there but the issue still occured. I have tried to follow the step discribe in enter link description here

我也有同样的问题,我尝试了很多解决办法,但问题仍然存在。我试着在这里输入链接描述的步骤描述。

and

enter link description here

在这里输入链接描述

And that , whttp://localhost/abc/trunk/abc/backend/web/?XDEBUG_SESSION_START=netbeans-xdebughen i debug my project, my netbeats still waiting connection till i have to had the following "?XDEBUG_SESSION_START=netbeans-xdebug" in my url as http://localhost/abc/trunk/abc/backend/web/?XDEBUG_SESSION_START=netbeans-xdebug so netbeans was able to connect with xdebug

,whttp:/ / localhost / abc /箱子/ abc /后端/ web / ?我调试我的项目,我的netbeats还在等待连接,直到我必须有下面的“?在我的url中,作为http://localhost/abc/trunk/backend/web/?XDEBUG_SESSION_START=netbeans-xdebug,因此netbeans能够与xdebug连接。

#4


0  

**On Windows 10 with Netbeans 8.0 running Netbeans built in webserver **

**在windows10上使用Netbeans 8.0运行在webserver **中构建的Netbeans。

The following options in the php.ini file resolved the issue for me:

以下是php中的选项。ini文件解决了我的问题:

zend_extension ='C:\path to php installation\ext\php_xdebug-2.5.0-5.6-vc11.dll' xdebug.remote_enable=on

zend_extension ='C:\path到php安装\ext\php_xdebug-2.5.0-5.6-vc11。dll ' xdebug.remote_enable =

This issue for me seemed to be resolved by using the full path to the .dll file. Also, because I had spaces in the path name I had to enclose the path in quotes (double vs single did not seem to matter). Also, I had to set the xdebug.remote_enable option. Once I set both options, I was able to select the Debug Application option within Netbeans and the debugger started.

对于我来说,这个问题似乎是通过使用.dll文件的完整路径来解决的。另外,因为我在路径名中有空格,所以我必须在引号内加上路径(double vs . single似乎不重要)。另外,我还必须设置xdebug。remote_enable选项。一旦我设置了这两个选项,我就能够在Netbeans中选择调试应用程序选项,并启动调试器。

#5


0  

i was facing a similar problem, in my case i had recently update my php version and the xdebug configuration were in the only php5 folder. had simply had to copy the old xdebug configuration to the new php.ini file of the new version and it worked like before.

我遇到了类似的问题,在我的例子中,我最近更新了我的php版本,而xdebug配置是在唯一的php5文件夹中。只需将旧的xdebug配置复制到新php中即可。新版本的ini文件,和以前一样。

some of the tips to debug this are:

调试的一些技巧是:

  1. first check if xdebug is install, run (php -v) if xdebug details aren't there then install and add the configuration.
  2. 首先检查xdebug是否安装、运行(php -v),如果没有xdebug细节,则安装并添加配置。
  3. open phpinfo() under xdebug category check if xdebug configuration is loaded.Check for the following settings.
    • remote_enable = on,remote_handler=dbgp
    • remote_enable =,remote_handler = dbgp
  4. 在xdebug类别下打开phpinfo(),检查是否加载了xdebug配置。检查以下设置。remote_enable =,remote_handler = dbgp

#1


25  

On Ubuntu 13.04 64bit php 5.4.9-4 Xdebug v2.2.3 netbeans 7.4
I have same problem and have solve it by:
1. go on http://xdebug.org/wizard.php follow the instructions to compile your own xdebug.so
2. in netbean 7.4 general options (sorry I haven't reputation 10 to post image) test connection. be sure correct settings on Proxy: to me "No Proxy" is working.
3. in php options debugging tab change xdebug setting port to other than 9001 or 9000. I choose 9002 but you can try until you find a free port (if port is not free nb tell you)
4. in php.ini OR for ubuntu users in /etc/php5/conf.d/20-xdebug.ini

在Ubuntu 13.04 64bit php 5.4.9-4 Xdebug v2.2.3 netbeans 7.4我有同样的问题,并且已经解决了:1。请按照以下说明编译您自己的xdebug。所以2。在netbean 7.4通用选项(抱歉,我没有把图片的图片)测试连接。在代理上确定正确的设置:对我来说“没有代理”是有效的。3所示。在php选项中,调试选项卡将xdebug设置端口更改为9001或9000。我选择9002,但你可以尝试直到你找到一个免费的港口(如果港口不是免费的nb告诉你)4。在php中。ini或ubuntu用户在/etc/php5/conf.d/20-xdebug.ini。

zend_extension=/usr/lib/php5/20100525/xdebug.so #where you ave put your reconpiled xdebug.so
[xdebug]
xdebug.remote_autostart=0
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_mode="req"
xdebug.remote_port=9002 # the port you have found free and set in netbeans above
xdebug.remote_host=127.0.0.1
xdebug.profiler_enable=0
xdebug.profiler_output_dir="/tmp/"
xdebug.idekey="netbeans-xdebug"
xdebug.remote_log="/home/#user_name#/xdebug.log" #your user name

zend_extension = / usr / lib / php5/20100525 / xdebug。所以,你要把你的reconstack xdebug放在哪里。所以xdebug xdebug。xdebug remote_autostart = 0。xdebug remote_enable = 1。xdebug remote_handler = " dbgp”。remote_mode = xdebug“要求”。remote_port=9002 #端口,您在xdebug.remote_host=127.0.0.1 xdebug中找到了空闲的并在netbeans中设置的端口。xdebug profiler_enable = 0。xdebug profiler_output_dir = " / tmp /”。idekey = " netbeans-xdebug " xdebug.remote_log = " / home / # user_name # / xdebug。日志“#你的用户名

5. sudo service apache2 restart

5。输入sudo服务重启

after do this I can debug php again.

这样做之后,我可以再次调试php。

#2


0  

Had same issue:

有同样的问题:

$ netstat | grep 9000
...
tcp6       1      0 localhost:9000          localhost:37486         CLOSE_WAIT

Solution: Restart NetBeans. There was running a dead Process waiting for connections.

解决方案:重新启动NetBeans。正在运行一个等待连接的死进程。

Here Netbeans with a running debug session. Note the CLOSE_WAIT and TIME_WAIT.

这里是运行调试会话的Netbeans。注意CLOSE_WAIT和TIME_WAIT。

tcp6       0      0 localhost:9000          localhost:38166         TIME_WAIT 

#3


0  

I had the same issue and I have tried many solution i had found out there but the issue still occured. I have tried to follow the step discribe in enter link description here

我也有同样的问题,我尝试了很多解决办法,但问题仍然存在。我试着在这里输入链接描述的步骤描述。

and

enter link description here

在这里输入链接描述

And that , whttp://localhost/abc/trunk/abc/backend/web/?XDEBUG_SESSION_START=netbeans-xdebughen i debug my project, my netbeats still waiting connection till i have to had the following "?XDEBUG_SESSION_START=netbeans-xdebug" in my url as http://localhost/abc/trunk/abc/backend/web/?XDEBUG_SESSION_START=netbeans-xdebug so netbeans was able to connect with xdebug

,whttp:/ / localhost / abc /箱子/ abc /后端/ web / ?我调试我的项目,我的netbeats还在等待连接,直到我必须有下面的“?在我的url中,作为http://localhost/abc/trunk/backend/web/?XDEBUG_SESSION_START=netbeans-xdebug,因此netbeans能够与xdebug连接。

#4


0  

**On Windows 10 with Netbeans 8.0 running Netbeans built in webserver **

**在windows10上使用Netbeans 8.0运行在webserver **中构建的Netbeans。

The following options in the php.ini file resolved the issue for me:

以下是php中的选项。ini文件解决了我的问题:

zend_extension ='C:\path to php installation\ext\php_xdebug-2.5.0-5.6-vc11.dll' xdebug.remote_enable=on

zend_extension ='C:\path到php安装\ext\php_xdebug-2.5.0-5.6-vc11。dll ' xdebug.remote_enable =

This issue for me seemed to be resolved by using the full path to the .dll file. Also, because I had spaces in the path name I had to enclose the path in quotes (double vs single did not seem to matter). Also, I had to set the xdebug.remote_enable option. Once I set both options, I was able to select the Debug Application option within Netbeans and the debugger started.

对于我来说,这个问题似乎是通过使用.dll文件的完整路径来解决的。另外,因为我在路径名中有空格,所以我必须在引号内加上路径(double vs . single似乎不重要)。另外,我还必须设置xdebug。remote_enable选项。一旦我设置了这两个选项,我就能够在Netbeans中选择调试应用程序选项,并启动调试器。

#5


0  

i was facing a similar problem, in my case i had recently update my php version and the xdebug configuration were in the only php5 folder. had simply had to copy the old xdebug configuration to the new php.ini file of the new version and it worked like before.

我遇到了类似的问题,在我的例子中,我最近更新了我的php版本,而xdebug配置是在唯一的php5文件夹中。只需将旧的xdebug配置复制到新php中即可。新版本的ini文件,和以前一样。

some of the tips to debug this are:

调试的一些技巧是:

  1. first check if xdebug is install, run (php -v) if xdebug details aren't there then install and add the configuration.
  2. 首先检查xdebug是否安装、运行(php -v),如果没有xdebug细节,则安装并添加配置。
  3. open phpinfo() under xdebug category check if xdebug configuration is loaded.Check for the following settings.
    • remote_enable = on,remote_handler=dbgp
    • remote_enable =,remote_handler = dbgp
  4. 在xdebug类别下打开phpinfo(),检查是否加载了xdebug配置。检查以下设置。remote_enable =,remote_handler = dbgp