How can you use php xdebug if you are on NAT behind a firewall?

断了今生、忘了曾经 提交于 2019-11-30 05:19:23
sorin

The solution I found was to use PuTTY to forward the port 9000 from the server to the client (IDE).

Just configure the Xdebug to connect to the localhost instead of an IP address your client (IDE) is running on:

xdebug.remote_host = localhost
xdebug.remote_port = 9000
xdebug.remote_connect_back = 0

There is a nice article called Remote Debugging PHP with a Firewall in the Way describing this and also the Xdebug configuration and SSH port forwarding method.

OZ_

Another variant is to use SSH port forwarding (can be used also in Cygwin).

Simply execute:

ssh -R 9000:127.0.0.1:9000 host.example.com

It creates a tunnel which forwards the port 9000 on the remote host to the port 9000 on the localhost.

Everything else is the same as in the PuTTY method (see sorin's answer).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!