0

I've been trying to set up Xdebug on a remote GCP Nginx server to work with SublimeText 3, but I cant get it to work - at all.

I used this guide to setup Xdebug on the server side. This seems to work fine. Xdebug.ini:

xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_log = /tmp/xdebug_remote.log
xdebug.remote_mode = req
xdebug.remote_port = 9005

I installed Xdebug Client in SublimeText3 with the correct project configurations. Then I allowed outgoing data from port 9005 from the GCP server console.

But I keep getting the error "Cannot connect to host :("

I think it has to do with the port listening being incorrect as per this answer but I can't figure out how to tunnel SSH in such a way that the connection between SublimeText and Xdebug on the remote server is set correctly.

All documentation I find is inconclusive to me; I've been at this on and off for months now. Can someone help me?

Asitis
  • 382
  • 3
  • 17
  • If all the communication happen inside the GCP server, you shouldn't need to modify Cloud Firewall rules for that. However, if your server is receiving incoming connections you do need to make sure there is a rule allowing it. Moreover, since the connections are between SublimeText and Xdebug over port 9005 (as in your settings), please check the appropriate processes are running and listening on that port. You can use "[sudo netstat -plnt](https://support.rackspace.com/how-to/checking-listening-ports-with-netstat/)" for that purpose. – Carlos Aug 17 '18 at 19:57
  • More information on GCP firewall rules can be found [here](https://cloud.google.com/vpc/docs/firewalls). You must also check that there is not a firewall inside the VM dropping the connection. – Carlos Aug 17 '18 at 20:30

0 Answers0