Re: Debugging PHP

This is a discussion on Re: Debugging PHP within the alt.comp.lang.php forums, part of the PHP Programming Forums category; "Rguy84" <ryan.benson@gmail.com> wrote in message news:40d38739-8e63-46f0-a644-cb4c61b9674d@i12g2000prf.googlegroups....


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-14-2008
Freelancer71
 
Posts: n/a
Default Re: Debugging PHP


"Rguy84" <ryan.benson@gmail.com> wrote in message
news:40d38739-8e63-46f0-a644-cb4c61b9674d@i12g2000prf.googlegroups.com...
> On Mar 12, 6:12 pm, "Freelancer71" <f93c0...@yahoo.com> wrote:
>> Is it possible to debug PHP code in dreamweaver 8?

>
> Debug how? There isn't anything that will say error on line 2. You'll
> have to echo variables or whatever to test. You can also use Eclipse
> and download the PHP pack.


By debug I mean execute the statements one by one or trace. Is that possible
with eclipse? Is it free?


Reply With Quote
  #2 (permalink)  
Old 03-14-2008
PaulB
 
Posts: n/a
Default Re: Debugging PHP

Freelancer71 wrote:
> "Rguy84" <ryan.benson@gmail.com> wrote in message
> news:40d38739-8e63-46f0-a644-cb4c61b9674d@i12g2000prf.googlegroups.com...
>> On Mar 12, 6:12 pm, "Freelancer71" <f93c0...@yahoo.com> wrote:
>>> Is it possible to debug PHP code in dreamweaver 8?

>>
>> Debug how? There isn't anything that will say error on line 2. You'll
>> have to echo variables or whatever to test. You can also use Eclipse
>> and download the PHP pack.

>
> By debug I mean execute the statements one by one or trace. Is that
> possible with eclipse? Is it free?


It is so easy to find errors on php pages because a script that stops
returns an error with the line number. Therefore the error is on that line
or the line before, (like a missing semicolon at the end of the previous
line). Each of the php structures are formed in small units and so may be
commented out or run individually and as others have said echo can be used
at each stage to show the variables. I'm not even using a local setup, I'm
editing and posting to a distant server but it's still a simple process.

I've done assembly language programming and there you do need step by step
because errors don't return a line number, the program just doesn't work but
php isn't like that, I don't see the need.

Paul

--
Add an underscore after the p to reply


Reply With Quote
  #3 (permalink)  
Old 03-14-2008
C.
 
Posts: n/a
Default Re: Debugging PHP

On 14 Mar, 08:30, "PaulB" <pb...@ntlworld.com> wrote:
> Freelancer71 wrote:
> > "Rguy84" <ryan.ben...@gmail.com> wrote in message
> >news:40d38739-8e63-46f0-a644-cb4c61b9674d@i12g2000prf.googlegroups.com...

>
> > By debug I mean execute the statements one by one or trace. Is that
> > possible with eclipse? Is it free?

>
> It is so easy to find errors on php pages because a script that stops
> returns an error with the line number. Therefore the error is on that line
> or the line before, (like a missing semicolon at the end of the previous
> line). Each of the php structures are formed in small units and so may be
> commented out or run individually and as others have said echo can be used
> at each stage to show the variables. I'm not even using a local setup, I'm
> editing and posting to a distant server but it's still a simple process.
>
> I've done assembly language programming and there you do need step by step
> because errors don't return a line number, the program just doesn't work but
> php isn't like that, I don't see the need.
>


That's only true for syntactic errors not semantic ones.

Having said that, IME, the most productive coders are those who learnt
their craft without line-by-line debuggers (N I'm not saying that such
debuggers will not improve efficiency - just that they have to be used
effectively and they can encourage bad habits - handle with care).

C.
Reply With Quote
  #4 (permalink)  
Old 03-14-2008
Michael Fesser
 
Posts: n/a
Default Re: Debugging PHP

..oO(Freelancer71)

>> Debug how? There isn't anything that will say error on line 2. You'll
>> have to echo variables or whatever to test. You can also use Eclipse
>> and download the PHP pack.

>
>By debug I mean execute the statements one by one or trace. Is that possible
>with eclipse? Is it free?


There's the Zend Debugger and Xdebug, but I can't say much about them
since I haven't used them yet.

http://www.google.de/search?num=25&q...nd+debugger%22

Micha
Reply With Quote
  #5 (permalink)  
Old 03-14-2008
Rguy84
 
Posts: n/a
Default Re: Debugging PHP

On Mar 13, 7:11 pm, "Freelancer71" <f93c0...@yahoo.com> wrote:
> "Rguy84" <ryan.ben...@gmail.com> wrote in message
>
> news:40d38739-8e63-46f0-a644-cb4c61b9674d@i12g2000prf.googlegroups.com...
>
> > On Mar 12, 6:12 pm, "Freelancer71" <f93c0...@yahoo.com> wrote:
> >> Is it possible to debug PHP code in dreamweaver 8?

>
> > Debug how? There isn't anything that will say error on line 2. You'll
> > have to echo variables or whatever to test. You can also use Eclipse
> > and download the PHP pack.

>
> By debug I mean execute the statements one by one or trace. Is that possible
> with eclipse? Is it free?


Just echo the statements... Yes its free
Reply With Quote
  #6 (permalink)  
Old 03-14-2008
Michael Fesser
 
Posts: n/a
Default Re: Debugging PHP

..oO(Rguy84)

>On Mar 13, 7:11 pm, "Freelancer71" <f93c0...@yahoo.com> wrote:
>
>> By debug I mean execute the statements one by one or trace. Is that possible
>> with eclipse? Is it free?

>
>Just echo the statements... Yes its free


echo is the poor man's debugger. In many simple cases it's usually
enough (I do the same, for example I have a debugLog() function that
simply writes the passed info to a shell on my second screen), but a
real debugger has a lot more capabilities to follow the program flow.

Micha
Reply With Quote
  #7 (permalink)  
Old 03-18-2008
Rguy84
 
Posts: n/a
Default Re: Debugging PHP

On Mar 14, 3:52 pm, Michael Fesser <neti...@gmx.de> wrote:
> .oO(Rguy84)
>
> >On Mar 13, 7:11 pm, "Freelancer71" <f93c0...@yahoo.com> wrote:

>
> >> By debug I mean execute the statements one by one or trace. Is that possible
> >> with eclipse? Is it free?

>
> >Just echo the statements... Yes its free

>
> echo is the poor man's debugger. In many simple cases it's usually
> enough (I do the same, for example I have a debugLog() function that
> simply writes the passed info to a shell on my second screen), but a
> real debugger has a lot more capabilities to follow the program flow.
>
> Micha


Nothing like this is for PHP which is built in, like other languagess,
ie JAVA.
Reply With Quote
  #8 (permalink)  
Old 03-18-2008
Michael Fesser
 
Posts: n/a
Default Re: Debugging PHP

..oO(Rguy84)

>On Mar 14, 3:52 pm, Michael Fesser <neti...@gmx.de> wrote:
>
>> echo is the poor man's debugger. In many simple cases it's usually
>> enough (I do the same, for example I have a debugLog() function that
>> simply writes the passed info to a shell on my second screen), but a
>> real debugger has a lot more capabilities to follow the program flow.

>
>Nothing like this is for PHP which is built in, like other languagess,
>ie JAVA.


Not sure I understood correctly. No language has a debugger built-in.
It's always an external tool or part of the IDE. For PHP there are at
least two real debuggers available, you just have to install and use
them.

Micha
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:45 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0