NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
HOWTO: Run debug session through SSH
Site Admin

Joined: 13 Jul 2003
Posts: 7835
Reply with quote
HOWTO: Run debug session through SSH

If you debug your scripts on a public server, you may want to do it in a secure way. In this case, have SSH daemon running on your server.
Then:
1. run PHPED IDE, open tools->settings, select Debugger tab, check "Use cusom port and host (ssh tunneling)", enter localhost in Debugger host.
NOTE: if there are multiple developers are working with the same server, each should run its own SSH tunnel on a unique port (say 7870:localhost:7870, 7871:localhost:7871 and so forth, see below) and this port should be entered in the DEBUGGER PORT setting.
2. open php.ini on the server and make sure that debugger.hosts_allow contains localhost alone:
Code:
debugger.hosts_allow=localhost
debugger.hosts_deny=ALL
debugger.ports=7869, 10000/16

NOTE: in case of multiple ports used, all the them should be listed in debugger.ports setting, for example debugger.ports=7869, 7870, 7871
3. run ssh on your client computer and connect it to the server using the command below:
Code:
ssh -R 7869:localhost:7869 username@serverhost

where username is your user account on the server and serverhost is hostname or server IP address.
NOTE: you'd have ssh client running with the command above each time you want to debug through SSH.
NOTE: you may want to enable compression by adding -C argument to ssh.
NOTE: starting with openssh v4.x, you may want to specify local binding IP, for example ssh -R localhost:7869:localhost:7869
NOTE: in case of multiple developers, see notes per p1


If you need an ssh client and/or server (daemon) for Windows please take a look here: CYGWIN. Check openssh package during install.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
HOWTO: Run debug session through SSH
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic