phpraspberry-pixdebugremote-debuggingserver-to-server

Remote X-Debugging PHP stuck while Server-2-Server communication


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?


Solution

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