更新时间:2023-12-03 18:42:40
您可以使用 ssh 将调试连接通过隧道返回到您的客户端计算机.例如.从您的客户端计算机,使用以下内容连接到服务器:
You can use ssh to tunnel the debug-connection back to your client machine. Eg. from your client machine, connect to the server with something like:
ssh -R 9000:localhost:9000 you@example.com
然后启动您的(本地)调试器,并启动远程脚本.Xdebug(在服务器上)现在将建立到它的 localhost:9000
的连接,但是由于这个端口被转发回你的本地机器,你的(本地)调试器将接收连接.
Then fire up your (local) debugger, and start the remote script. Xdebug (at the server) will now establish a connection to its localhost:9000
, but since this port is forwarded back to your local machine, your (local) debugger will receive the connection.
如果你在客户端使用 Windows,你可以用 PuTTY 做同样的事情.
If you use Windows on your client side, you can do the same thing with PuTTY.