I am trying to initiate remote debugging from my laptop to my remote server. I am usually behind either my home router or someone else's router + hardware firewall, etc. Because of this I would like to set up remote debugging by opening an ssh tunnel through port 9000 to my remote server. (Note: I haven't been able to get remote debugging working, even without the tunnel)
First I open the ssh tunnel by using the following from my home laptop: (which of course, successfully connects!)
`ssh -i devtest.pem -R 9000:127.0.0.1:9000 firstname.lastname@example.org`
I get the following output when I run the following command on the remote server: `netstat -tln | grep 9000`
tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN
tcp6 0 0 ::1:9000 :::* LISTEN
Next I have set up my php.ini on PHP - CLI, (I edit php cli ini file because I will be testing only PHPUnit test cases)
xdebug.default_enable = 1
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
xdebug.remote_host = 127.0.0.1
xdebug.remote_log = /home/ubuntu/xdebug.log
xdebug.remote_port = 9000
I use remote_host = 127.0.0.1 because I figure that the 127.0.0.1:9000 is the loopback address that will redirect xdebug content back to my home computer (I am not sure if I am correct here).
To confirm that I have the correct settings in my PhpStorm I will now post some images (attached) of my settings when attempting to set up PHPUnit remote debugging:
As you can see when I start debugging, I only get a waiting for connections prompt on the debugging console and it has a random idekey chosen, I want to hope that phpstorm is setting this idekey itself when it contacts the remote server.
Does anyone have any suggestions as to how I would get this setup to work?
Thanks a lot