xDebug 使用netbeans进行远程调试

发布于 2024-09-30 17:07:23 字数 1732 浏览 9 评论 0原文

我正在尝试使用 xdebug 远程调试到我的服务器,我在服务器上的 php ini 中有以下内容:

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"

我尝试过仅使用remove_host和remote_connect_back,但似乎都没有建立连接。我在 netbeans 中收到等待连接输出。

我已确保服务器上的端口 9000 对于传出和传入 tcp 连接打开,并且在启动调试器时,我从远程服务器上的 tcpdump 获得以下输出:

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

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

04:48:14.000034 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) win 5840 (DF)

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

04:48:50.000018 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) win 5840 (DF)

我不熟悉 tcpdump 但它看起来只是一种单向通信,我只是不确定从哪一侧?

另外,我在 netbeans 中的项目配置是:

远程网站 FTP SFTP

项目 Url: http://site.ca

索引(空白)

参数(空白)

远程连接:(设置并测试)

上传目录:(空白)

上传文件:Mnaually

Preserver..:未选中

直接上传..:未选中

高级:

--打开浏览器

--路径映射设置服务器并本地到/public_html/文件夹都带有尾随破折号 -- 没有调试器代理

我已经能够让 netbeans 在本地与 xdebug 一起用于 Web 和 cli,但似乎无法使其在远程工作。非常感谢任何帮助。

干杯,

杰伊

I'm trying to use xdebug to debug remotely to my server, I have the following in my php ini on the server:

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. I receive a waiting for connection output in 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:

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

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

04:48:14.000034 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) win 5840 (DF)

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

04:48:50.000018 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) win 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?

Also my project configuration in netbeans is:

Remote Website FTP SFTP

Project Url: http://site.ca

Index (blank)

Arguments (blank)

Remote Connection: (set and tested)

Upload Directory: (blank)

Upload Files: Mnaually

Preserver..: unchecked

upload directly..: unchecked

Advanced:

-- Open browser

-- Path Mapping set server and locally to /public_html/ folders both with trailing dashes
-- No debugger proxy

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. Any help is greatly appreciated.

Cheers,

Jay

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

恍梦境° 2024-10-07 17:07:23

您的 Netbeans 是否知道它必须监听 9000 才能进行 XDebug?

我对你的帐户有点困惑,但如果你的 apache 没有在本地运行,那么你必须指定一个远程主机 IP,以便 XDebug 可以连接回来。尽管如此,你的remote_connect_back应该已经工作了。

您是否将本地防火墙配置为允许 XDebug 端口上的传入请求?

最佳

拉斐尔

Does your Netbeans know that it has to listen to 9000 for 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. Though then your remote_connect_back should have worked.

Did you configure your local firewall to allow incoming requests on your XDebug-port?

Best

Raffael

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文