FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » PHP Debugger which can set breakpoint and view variables on watch window
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
PHP Debugger which can set breakpoint and view variables on watch window [message #178827] Fri, 10 August 2012 08:14 Go to next message
Lightee is currently offline  Lightee
Messages: 2
Registered: August 2012
Karma: 0
Junior Member
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.
Re: PHP Debugger which can set breakpoint and view variables on watch window [message #178828 is a reply to message #178827] Fri, 10 August 2012 11:58 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
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(at)attglobal(dot)net
==================
Re: PHP Debugger which can set breakpoint and view variables on watch window [message #178829 is a reply to message #178827] Fri, 10 August 2012 12:50 Go to previous messageGo to next message
Michael Vilain is currently offline  Michael Vilain
Messages: 88
Registered: September 2010
Karma: 0
Member
In article <d215b5e4-d65a-4ace-89f9-c65c0db83672(at)googlegroups(dot)com>,
Lightee <lightaiyee(at)gmail(dot)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/configure-php-environment-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-for-eclipse.html?src=greybox

--
DeeDee, don't press that button! DeeDee! NO! Dee...
[I filter all Goggle Groups posts, so any reply may be automatically ignored]
Re: PHP Debugger which can set breakpoint and view variables on watch window [message #178834 is a reply to message #178828] Fri, 10 August 2012 22:38 Go to previous messageGo to next message
Ross McKay is currently offline  Ross McKay
Messages: 14
Registered: January 2011
Karma: 0
Junior Member
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"
Re: PHP Debugger which can set breakpoint and view variables on watch window [message #178835 is a reply to message #178827] Fri, 10 August 2012 22:47 Go to previous messageGo to next message
Ross McKay is currently offline  Ross McKay
Messages: 14
Registered: January 2011
Karma: 0
Junior Member
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
Re: PHP Debugger which can set breakpoint and view variables on watch window [message #178851 is a reply to message #178827] Mon, 13 August 2012 08:00 Go to previous message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma: 0
Senior Member
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
--
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: problem in creating Zip file
Next Topic: parameters with numbers
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 01:08:22 GMT 2024

Total time taken to generate the page: 0.02401 seconds