简体   繁体   English

使用NetBeans进行xDebug远程调试

[英]xDebug remote debugging using netbeans

I'm trying to use xdebug to debug remotely to my server, I have the following in my php ini on the server: 我正在尝试使用xdebug远程调试服务器,我在服务器上的php ini中具有以下内容:

zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so" zend_extension =“ / usr / local / lib / php / extensions / no-debug-non-zts-20090626 / xdebug.so”

[XDebug]
xdebug.remote_enable = 1
;xdebug.remote_host = "<MYIP>"
xdebug.remote_port = 9000
xdebug.idekey = "netbeans-xdebug"
xdebug.remote_connect_back = 1
xdebug.remote_handler="dbgp"
xdebug.remote_log = "/var/log/xdebug.log"

I've tried with just remove_host and just remote_connect_back and neither seems to get a connection. 我试过只是remove_host和remote_connect_back,似乎都没有连接。 I receive a waiting for connection output in netbeans. 我在netbeans中收到一个等待连接的输出。

I've ensured that the port 9000 is open on the server for outgoing and incoming tcp connections and when starting the debugger I get this output from tcpdump on the remote server: 我确保在服务器上打开了端口9000,以进行传出和传入的tcp连接,并且在启动调试器时,我从远程服务器上的tcpdump获得了以下输出:

04:48:05.003307 server.25096 > local.9000: S 49319161:49319161(0) win 5840 (DF) 04:48:05.003307 server.25096> local.9000:S 49319161:49319161(0)赢得5840(DF)

04:48:08.000027 server.25096 > local.9000: S 49319161:49319161(0) win 5840 (DF) 04:48:08.000027 server.25096> local.9000:S 49319161:49319161(0)赢得5840(DF)

04:48:14.000034 server.com.25096 > local.9000: S 49319161:49319161(0) win 5840 (DF) 04:48:14.000034 server.com.25096> local.9000:S 49319161:49319161(0)赢得5840(DF)

04:48:26.000018 server.com.25096 > local.9000: S 49319161:49319161(0) win 5840 (DF) 04:48:26.000018 server.com.25096> local.9000:S 49319161:49319161(0)赢得5840(DF)

04:48:30.290025 server.com.25085 > local.9000: S 4252863523:4252863523(0) win 5840 (DF) 04:48:30.290025 server.com.25085> local.9000:S 4252863523:4252863523(0)赢得5840(DF)

04:48:50.000018 server.com.25096 > local.9000: S 49319161:49319161(0) win 5840 (DF) 04:48:50.000018 server.com.25096> local.9000:S 49319161:49319161(0)赢得5840(DF)

04:49:38.000026 server.com.25096 > local.9000: S 49319161:49319161(0) win 5840 (DF) 04:49:38.000026 server.com.25096> local.9000:S 49319161:49319161(0)赢得5840(DF)

I'm not familiar with tcpdump but it looks like only a one way communication, I'm just not sure from which side? 我对tcpdump并不熟悉,但它看起来只是一种单向通信,我不确定从哪一侧开始?

Also my project configuration in netbeans is: 另外,我在netbeans中的项目配置是:

Remote Website FTP SFTP 远程网站FTP SFTP

Project Url: http://site.ca 项目网址: http//site.ca

Index (blank) 索引(空白)

Arguments (blank) 参数(空白)

Remote Connection: (set and tested) 远程连接:(设置并经过测试)

Upload Directory: (blank) 上传目录:(空白)

Upload Files: Mnaually 上传文件:每月

Preserver..: unchecked Preserver ..:未选中

upload directly..: unchecked 直接上传..:未选中

Advanced: 高级:

-- Open browser -打开浏览器

-- Path Mapping set server and locally to /public_html/ folders both with trailing dashes -- No debugger proxy -路径映射将服务器和本地映射到/ public_html /文件夹都带有尾划线-无调试器代理

I've been able to get netbeans working with xdebug locally for web and cli but can't seem to get it working for remote. 我已经能够使netbeans在本地为Web和cli使用xdebug,但似乎无法使其在远程工作。 Any help is greatly appreciated. 任何帮助是极大的赞赏。

Cheers, 干杯,

Jay 周杰伦

Does your Netbeans know that it has to listen to 9000 for XDebug? 您的Netbeans知道它必须侦听9000的XDebug吗?

I'm bit confused by your account but in case your apache isn't running locally then you have to specify a remote_host-IP, so XDebug can connect back. 我对您的帐户感到困惑,但是如果您的apache不在本地运行,则必须指定remote_host-IP,以便XDebug可以重新连接。 Though then your remote_connect_back should have worked. 虽然那样,您的remote_connect_back应该可以正常工作了。

Did you configure your local firewall to allow incoming requests on your XDebug-port? 您是否将本地防火墙配置为允许XDebug端口上的传入请求?

Best 最好

Raffael 拉斐尔

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM