ElkArte Community

Title: Debugging PHP code in editor
Post by: Joker™ on October 22, 2014, 09:35:03 am
Yeyy, at last I did it :D. Failing every weekend for a month, I've managed to setup the dev environment on my laptop as desired.

OS - Mac OS X (yosemite)
Editor - Sublime text 2
PHP Debugger extension - XDebugger

And now I can debug the running php code in my editor itself.

Moreover with this, I'm installing elkarte on my personal webpage, and going to convert it into a custom blog thinggy.

/me can see ajax development getting simplified by at least 60%, and crushing issues way too easy. Just too excited
.
Title: Re: Debugging PHP code in editor
Post by: Spuds on October 22, 2014, 06:53:07 pm
Sounds awesome :D

xdebug is a great tool to help  find and fix problems, I have my environment set up to run it when needed.    Just have to set the break point in the code, the debugger steps in and you can walk the code and see the value of variables, etc etc etc

Have fun with your new toy(s)!
Title: Re: Debugging PHP code in editor
Post by: IchBin on October 22, 2014, 07:09:58 pm
Debugging is the shizzle when you get it working. I've never done it with PHP yet though. lol
Title: Re: Debugging PHP code in editor
Post by: emanuele on October 22, 2014, 07:11:33 pm
/me should probably spend some time setting up such a thing...

I tend to use echo's and log_error... lol
Title: Re: Debugging PHP code in editor
Post by: Spuds on October 22, 2014, 09:16:34 pm
Those tend to be my go to's as well for a quick debug or just see whats happening from time to time.  Heck 1/2 the time I foget to remove them before I commit  O:-)

But when that fails, a debugger is a cool tool to have in the bag, really lets you take control :D
Title: Re: Debugging PHP code in editor
Post by: Joker™ on October 27, 2014, 12:20:32 pm
Okzzz, looking as public demand Joker is going to post a tutorial about how to integrate all these debugging things with the editor, but can I jazz cookies for it O:-)
Title: Re: Debugging PHP code in editor
Post by: Spuds on October 27, 2014, 12:28:12 pm
Code: [Select]
setcookie("CookieForJoker", "For debugz integration");
  :P
Title: Re: Debugging PHP code in editor
Post by: emanuele on October 27, 2014, 12:46:38 pm
/me likes the idea!
/me goes cook some cookies for tah Jokerz.

/me hopes the cookies will arrive after tah Jokerz has written the tutorial, otherwise he may not be able to write it (because of death by poisoning due to my wonderful culinary skillz! :P).
Title: Re: Debugging PHP code in editor
Post by: Joker™ on December 13, 2014, 09:07:18 am
Lol I formatted my mac and lost the changes myself, but there are some quick notes available in my mail, if it makes any sense to anyone for now. Do note this is for mac + sublime text 2

Quotehttp://blog.laaz.org/tech/2010/08/27/xdebug-with-xampp-on-mac-os-x/

then add settings
http://docs.joomla.org/Edit_PHP.INI_File_for_XDebug

zend_extension="/Applications/XAMPP/xamppfiles/lib/php/php-5.2.9/extensions/no-debug-non-zts-20060613/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_port=9000
cgi.force_redirect = 0

http://erik.torgesta.com/2012/12/debugging-php-with-sublime-text-2/
install python using brew

install plugins etc mentioned
Title: Re: Debugging PHP code in editor
Post by: emanuele on December 26, 2014, 04:22:34 pm
In the end this evening I decided to just fire up netbeans and configure it. :P

It helped! :D
Title: Re: Debugging PHP code in editor
Post by: Joker™ on January 31, 2015, 05:01:08 am
Quote from: emanuele – In the end this evening I decided to just fire up netbeans and configure it. :P

It helped! :D
Your welcome :)