Debug PHP target on WebInspector

49 views
Skip to first unread message

msn2wolf

unread,
Apr 17, 2013, 11:37:10 PM4/17/13
to haxe...@googlegroups.com
Hi all, I made a small debugger client for server-side PHP using XDebug and Webkit's WebInspector on Haxe. I'm releasing it GPL'd on GitHub free for anyone to use, review and/or contribute.

Why? 
Well, I know XDebug already has a lot of supported IDEs on the wild. However the current XDebug protocol requires that your webserver has access to directly connect to your computer on port 9000 as a security method. Now, sometimes you can enable it if you have access to your internet gateway to configure some port forwarding but sometimes you just cant. So, by having a web-based debugger you can setup a different access control like user/password login. 
  There are also some XDebug Proxies but having a web-based debugger provides additional benefits that a XDebug proxy would not provide.

Why WebInspector and not X? 
For me web-inspector has proven to be an excellent tool for debugging Javascript code on the client side. Besides has the following reasons:
1) Its web-based
2) Its open-source, therefore all the source code is available. 
3) The protocol is well documented and open (JSON based).
4) Most importantly WebInspector has excellent support for SourceMaps that seems to me like the Holy grail for a cross compiler like HaXe where the output code is on a different target than the source code. My next goal would be to be able to step thru the original HaXe code and be able to set breakpoints and inspect variables directly on Haxe for PHP targets.

I'm open to any criticism, comments or questions. My contact info is: msn2wolf at gmail dot com

You can find the GitHub project at:

BP

unread,
Apr 18, 2013, 8:43:07 AM4/18/13
to haxe...@googlegroups.com
hmmm.... very interesting! i don't do much PHP work, but since PHP doesn't run in the browser per se, would it be somewhat easy to adapt this so C++ targets could be debugged using the webkit WebInspector? I know it seems like a weird place to do it, but if you've got all the legwork done of connecting up to WebInspector, it seems to me like it might be pretty easy to integrate using the interface that Hugh details here:

msn2wolf

unread,
Apr 18, 2013, 9:36:52 AM4/18/13
to haxe...@googlegroups.com
Great idea, I'll take a deeper look into it. I have been trying to keep the Native Debugger connection code separate in an adapter class, although I have to abstract the interfaces a little more. In any case, it seems we could easily adapt it to speak with the hxcpp.DebugSocket.
  I'm going to research on it.

Thanks.

Franco Ponticelli

unread,
Apr 18, 2013, 11:25:18 AM4/18/13
to haxe...@googlegroups.com
Very cool :)


--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jason O'Neil

unread,
Apr 18, 2013, 9:15:43 PM4/18/13
to haxe...@googlegroups.com
Very cool.

I'm not familiar enough with WebInspector so I don't really get how this works at the moment, but the general concept looks very cool.  If it could be adapted to targets other than PHP then you may have just created one of the most requested pieces of Haxe tooling yet :)

Will have to have a play later on.

Manuel Lobo

unread,
Apr 19, 2013, 12:29:04 PM4/19/13
to haxe...@googlegroups.com
Hi All,
   Thanks you all for your feedback. BP suggested I should add a walkthrought installation and running instructions so I added some on GitHub.
   The Web-based debugger interface can be run on any server, doesn't need to be on your PHP/Webserver. To do that you will have to adjusting the configuration parameters on XDebug and of course the URLs used.
Regards.

BP

unread,
Apr 19, 2013, 3:53:45 PM4/19/13
to haxe...@googlegroups.com
Cool! Thanks for the info on how to set it up.... I'll take a look at it this weekend and let you know how I make out....
Reply all
Reply to author
Forward
0 new messages