Skip to main content
Topic: Debugging PHP code in editor (Read 3143 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Debugging PHP code in editor

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.

 Joker can see ajax development getting simplified by at least 60%, and crushing issues way too easy. Just too excited
.

Re: Debugging PHP code in editor

Reply #1

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)!

Re: Debugging PHP code in editor

Reply #2

Debugging is the shizzle when you get it working. I've never done it with PHP yet though. lol
Success is not the result of spontaneous combustion, you must set yourself on fire!

Re: Debugging PHP code in editor

Reply #3

 emanuele should probably spend some time setting up such a thing...

I tend to use echo's and log_error... lol
Bugs creator.
Features destroyer.
Template killer.

Re: Debugging PHP code in editor

Reply #4

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

Re: Debugging PHP code in editor

Reply #5

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:-)

Re: Debugging PHP code in editor

Reply #6

Code: [Select]
setcookie("CookieForJoker", "For debugz integration");
  :P

Re: Debugging PHP code in editor

Reply #7

 emanuele likes the idea!
 emanuele goes cook some cookies for tah Jokerz.

 emanuele 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).
Bugs creator.
Features destroyer.
Template killer.

Re: Debugging PHP code in editor

Reply #8

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

Re: Debugging PHP code in editor

Reply #9

In the end this evening I decided to just fire up netbeans and configure it. :P

It helped! :D
Bugs creator.
Features destroyer.
Template killer.