|
|||
|
Dear PHP gurus,
I just started reading up on PHP a few weeks ago. Borrowed a number of books but none of them could recommend a debugger which can set breakpoint and view variables on watch window. Is it possible to have a debugger like Visual Studio where one can step through the code, view how the variables change in a watch window? This is essential for good quality code and debugging. Not sure if this is a limitation of PHP or I am ignorant. Does such a debugger exist? Thank you. |
|
|
||||
|
||||
|
|
|
|||
|
On 8/10/2012 4:14 AM, Lightee wrote:
> Dear PHP gurus, > > I just started reading up on PHP a few weeks ago. Borrowed a number of books but none of them could recommend a debugger which can set breakpoint and view variables on watch window. Is it possible to have a debugger like Visual Studio where one can step through the code, view how the variables change in a watch window? This is essential for good quality code and debugging. > > Not sure if this is a limitation of PHP or I am ignorant. Does such a debugger exist? > > Thank you. > http://www.lmgtfy.com/?q=php+debugger Although I disagree that it's "essential". It is nice to have, but a good programmer can easily work without a debugger. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|||
|
In article <d215b5e4-d65a-4ace-89f9-c65c0db83672@googlegroups.com>,
Lightee <lightaiyee@gmail.com> wrote: > Dear PHP gurus, > > I just started reading up on PHP a few weeks ago. Borrowed a number of books > but none of them could recommend a debugger which can set breakpoint and view > variables on watch window. Is it possible to have a debugger like Visual > Studio where one can step through the code, view how the variables change in > a watch window? This is essential for good quality code and debugging. > > Not sure if this is a limitation of PHP or I am ignorant. Does such a > debugger exist? > > Thank you. It's not part of the language, if that's what you're asking. Perl has a built-in debugger with breakpoints, tracepoints, etc. but the only way I've been able to debug php is through var_dump() statements placed in piece of code. I haven't looked much into NetBeans, but it's a development IDE for Java that also supports php debugging. It may be your best solution. http://netbeans.org/kb/docs/php/conf...nt-mac-os.html Zend Studio IDE is $299. It also has the debugger you're looking for. And an optimized server meant for a full LAMP Production environment. http://shop.zend.com/en/zend-studio-...ml?src=greybox -- DeeDee, don't press that button! DeeDee! NO! Dee... [I filter all Goggle Groups posts, so any reply may be automatically ignored] |
|
|||
|
On Fri, 10 Aug 2012 07:58:46 -0400, Jerry Stuckle wrote:
>Although I disagree that it's "essential". It is nice to have, but a >good programmer can easily work without a debugger. When working on your own code that may well be the case (generally is for me), but when working with someone else's code a debugger can be not just a big help, but a huge time saver. There's a certain WordPress jobs board plugin that I had to deal with earlier this year, written in some custom MVC framework, and it was just impossible to follow the invisible bouncing ball without a debugger. OK, maybe not impossible, I could have peppered stack dumps through his code, but a debugger got me the answers I needed much faster than messing around with instrumenting his code. -- Ross McKay, Toronto NSW Australia "Click me, drag me, treat me like an object" |
|
|||
|
On Fri, 10 Aug 2012 01:14:27 -0700 (PDT), Lightee wrote:
>[...] Does such a debugger exist? I use Netbeans for debugging. In fact, I only use it for debugging, but it's very good for that. You need to have Xdebug installed and enabled on your server, and it helps to install the Xdebug extension for your browser of choice (I know they exist for Chrome, Firefox and Opera at least). If you're running Linux, you can probably install Xdebug from your package manager. http://netbeans.org/kb/docs/php/debugging.html http://xdebug.org/docs/remote (has list of debug clients and extensions) -- Ross McKay, Toronto, NSW Australia "Let the laddie play wi the knife - he'll learn" - The Wee Book of Calvin |
|
|||
|
El 10/08/2012 10:14, Lightee escribió/wrote:
> I just started reading up on PHP a few weeks ago. Borrowed a number > of books but none of them could recommend a debugger which can set > breakpoint and view variables on watch window. Is it possible to have > a debugger like Visual Studio where one can step through the code, > view how the variables change in a watch window? This is essential > for good quality code and debugging. > > Not sure if this is a limitation of PHP or I am ignorant. Does such a > debugger exist? Such debugger exists, but it isn't part of the language itself. It's composed of two parts: 1. A server-side library you plug into your PHP installation 2. A client-side tool to interact with the first component .... and there are several alternatives to choose for. For #1, the most common option is Xdebug, probably because it's the only decent free tool out there (all other tools I know are proprietary and cost money). It's reasonably good, but you must be sure you follow the official documentation if you want to configure it: docs you find out there tend to be pretty outdated. For #2, you need a tool that's compatible with your first choice. As far as I know, most IDEs (but not all) support Xdebug: NetBeans IDE, Exclipse, PhpStorm, Komodo IDE... Some IDEs force you to use their own Apache+PHP+Xdebug bundle, which can make things more difficult to understand. Additionally, there're browser extensions for Firefox, Chrome, Opera... that simplify enabling and disabling debugging. -- -- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain -- Mi sitio sobre programación web: http://borrame.com -- Mi web de humor satinado: http://www.demogracia.com -- |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|