远程X

编程入门 行业动态 更新时间:2024-10-28 04:26:55
远程X-Debugging在Server-2-Server通信时卡住了(Remote X-Debugging PHP stuck while Server-2-Server communication)

我正在开发一个使用PHP的Web服务,它将通过来自外部网站的curl调用来获取数据。 为了开发,我在我的本地网络中使用带有PHP的Apache Web服务器(称为服务器A)。 出于测试目的,我还设置了一个虚拟服务,以避免对外部服务提出许多无用或不良请求。 这个假人运行在另一个树莓上,使用相同的安装程序,将其称为服务器B.在服务器A和B上,我都部署了XDebug。 为了发展,我使用Netbeans。

当我远程调试服务器上的PHP-Scrips时,一切运行良好,除非我运行/调试对服务器B上的虚拟服务进行卷曲调用的脚本。 如果是这种情况,则执行停止,直到退出调试模式。 如果我这样做,那么这些脚本就会正常完成。

我不确定是什么让脚本暂停,所以我不知道如何避免这种情况。 在这种情况下我能做些什么来使调试工作?

I am developing a web service using PHP, which will fetch data through a curl-call from a foreign website. For developing, I use an Apache Webserver with PHP on a raspberry pi in my local network (call it Server A). For testing purposes, I've also set up a dummy service to avoid to many useless or bad request to the foreign service. This dummy runs on another Raspberry, with the same Setup, call it Server B. On both Servers A and B, I've deployed XDebug. For developent, I use Netbeans.

When I remotely debug PHP-Scrips on Server A everything runs fine, unless I run/debug a scrip in which a curl-call to the Dummy-Service on Server B is made. If that is the case, the execution halts until I exit the debugging mode. If I do so, the scrips finish normal.

I am not sure what makes the scrip halt, so I've no idea how to avoid this. What can I do to make debugging work in this case?

最满意答案

好的,找到了解决方案。 如果两台服务器使用相同的端口(9000)与我正在调试的PC进行通信,那么显然是一个问题。

在将其中一台服务器设置为9001之后,我可以一次将调试器连接到一台服务器,具体取决于NetBeans设置的端口号。

OK, found a solution. It obviously is a problem if both servers use the same port (9000) for communicating with the PC I am debugging on.

After setting one of the servers to 9001 instead, i can attach the debugger to one server at a time, depending on what port is set in Netbeans to listen on.

更多推荐

本文发布于:2023-07-22 02:11:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1215993.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!