|
|
 |
|
|
Setting up php debugger communications with SSH
This is the set of instructions to setup, troubleshoot and fix the communications between dbg - php debugger and PhpED - PHP IDE.
Related troubleshooting instructions can be found here: Failed to connect to the client address message and connection to the client address <address> is not allowed message
HOWTO: Run php debugger 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, you should have SSH daemon running on your server.
Then:
- Start PhpED - PHP IDE. Make sure that Tools->Settings->IDE->Run&Debug has
- use custom port and host box checked
- localhost written for Debugger host
- Open php.ini on the server (machine where dbg is installed) and make sure that debugger.hosts_allow contains localhost alone:
- debugger.hosts_allow=localhost
- debugger.hosts_deny=ALL
- debugger.ports=7869, 10000/16
- Make sure that DbgListener is running on PhpED machine - check that satellite dish icon is in system tray.
- Make sure ssh tunnel is running on the client computer. For example, if you are running cigwyn SSH client on your PhpEd machine you can open SSH tunnel with the following command: ssh -R localhost:7869:localhost:7869 serveraccount@server. (where serveraccount is your user account on the server and server is hostname or server IP address.) This ssh command tells ssh client to open the tunnel to the "server" and forward the traffic on the port 7869 of that server to localhost's port 7869. THIS COMMAND MUST BE EXECUTED ON PhpED's computer and not on the server!
- 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: If you need an ssh client and/or server (daemon) for Windows please take a look here: http://cygwin.com
- Make sure sshd (server host - machine where dbg is installed) has opened forwarded listening socket. The following command below should show 7869 port in listening state (this assumes that you left default debugger port 7869 unchanged): netstat -na|grep 7869
- Stop your Web Server - please note that re-load may not work! Stop and start it again
- At this point you should be all set. You can check the communications between dbg and PhpED are working following the instructions here.
|
|
|  |
|