I decided to try and run a debug proxy so I could run multiple connections to xdebug from KomodoIDE.
That has caused a lot of frustration.
First I copied the dbgpproxy files to the server.
I then hacked php.ini as suggested setting the xdebug.remote_host to localhost/127.0.0.1 so my php.ini looked like this:
xdebug.remote_enable = true
xdebug.remote_host = 127.0.0.1
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.remote_log = /var/log/xdebug.log
xdebug.remote_mode = req
Restarted Apache and then I then ran the proxy like this:
root@home php.ini]# python /root/dbgp/bin/pydbgpproxy -l DEBUG
INFO: dbgp.proxy: starting proxy listeners. appid: 9795
INFO: dbgp.proxy: dbgp listener on 127.0.0.1:9000
INFO: dbgp.proxy: IDE listener on 127.0.0.1:9001
In Komodo I set the Listening port to 'system provided free port'
I set 'I am listening to a proxy' and added the IP and port of the server
But I kept getting errors:
Failed to start the listener socket on port 9001, error: -1 (the debugger proxy could not be contacted.)
If I tried to debug a file like this:
https://192.168.10.1/Test.php?XDEBUG_SESSION_START=users
I would get a proxy error like this:
WARNING: dbgp.proxy: No server with key [users], stopping request
Having tried multiple settings I finally found this page which gave me the clue :
https://confluence.jetbrains.com/display/PhpStorm/Multi-user+debugging+in+PhpStorm+with+Xdebug+and+DBGp+proxy
You have to set the proxy like this.
-i proxyserverExternalIP:port you specify in the proxy settings
-d IP:local debug port on the server (set in php.ini)
e.g.:
python /root/dbgp/bin/pydbgpproxy -d 127.0.0.1:9000 -i 192.168.10.1:9001
And presto ! You can now connect multiple users.
Somewhere to stick my notes on stuff I've learned. Hopefully it will come in useful to someone, somewhere.
Showing posts with label debug. Show all posts
Showing posts with label debug. Show all posts
Sunday, November 6, 2016
Wednesday, December 19, 2012
Eclipse debugging problems
Lord I could write volumes on Eclipse, and regrettably much of it would involving hurling computers out of upper storey windows and smashing my brain against a large immovable object.
It's a love hate kinda thing. I love it, when it works. But boy do I hate it when it doesn't. It throws more temper tantrums than my entire family put together. The ide(a) is great. The execution is akin to that of Mary Queen of Scots. Slightly messy, and may take several blows to entirely sever the head. Yuck. But I digress.
I have a CentOS based server (my beloved little contribs.org) with Zend Debugger on it. Took a while to get it right. And don't forget to change Zend versions with PHP. Oh, and the odd problem with missing libraries (see earlier posts)
Anyway, after I upgraded to Juno I seem to be plagued with problems. The mess first stemmed from not sorting out my projects properly when I upgraded. Should have committed the lot to SVN and started again. But I was between things, didn't want to commit a whole pile of stuff that probably wouldn't happen (I know, I know....branches & all that jazz) so I cheated. Damn, damn, damn.
The worst problem has been getting the debugger running properly so here are some things to watch for.
If all else fails, lob it out of the window and get a beer :-)
It's a love hate kinda thing. I love it, when it works. But boy do I hate it when it doesn't. It throws more temper tantrums than my entire family put together. The ide(a) is great. The execution is akin to that of Mary Queen of Scots. Slightly messy, and may take several blows to entirely sever the head. Yuck. But I digress.
I have a CentOS based server (my beloved little contribs.org) with Zend Debugger on it. Took a while to get it right. And don't forget to change Zend versions with PHP. Oh, and the odd problem with missing libraries (see earlier posts)
Anyway, after I upgraded to Juno I seem to be plagued with problems. The mess first stemmed from not sorting out my projects properly when I upgraded. Should have committed the lot to SVN and started again. But I was between things, didn't want to commit a whole pile of stuff that probably wouldn't happen (I know, I know....branches & all that jazz) so I cheated. Damn, damn, damn.
The worst problem has been getting the debugger running properly so here are some things to watch for.
- 1. Check your php.ini - don't guess or assume. Use php -v & php -m
- 2. Use phpinfo - don't guess or assume. Zend Debugger info appear ????
- 3. See here for 'incompatible version' - try changing to a different port - see this bug which should have been fixed yonks ago. Grrrrrrrr.
- 4. Got something going on like DLTK processing ??? That can stop the whole thing. Try closing off ALL projects except the one you want (did it for me in this instance)
If all else fails, lob it out of the window and get a beer :-)
Subscribe to:
Posts (Atom)
