PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > Debugging PHP scripts
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Debugging PHP scripts

Réponse
 
LinkBack Outils de la discussion
Vieux 29/08/2008, 17h33   #1
Edward Diener
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Debugging PHP scripts

I am fairly new to PHP. What is the best way of debugging PHP scripts ?

I have put in echo statements to tell me what is happening, but perhaps
there are better methods.

I have a PHP script on a server, which I access from a client side
program ( written in C++ ) and the script is not returning the correct
data. I am looking for some easy way to determine what is wrong.

Thanks !
  Réponse avec citation
Vieux 29/08/2008, 17h36   #2
Dan Joseph
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Debugging PHP scripts

On Fri, Aug 29, 2008 at 11:33 AM, Edward Diener <eldiener@tropicsoft.com>wrote:

> I am fairly new to PHP. What is the best way of debugging PHP scripts ?
>
> I have put in echo statements to tell me what is happening, but perhaps
> there are better methods.
>
> I have a PHP script on a server, which I access from a client side program
> ( written in C++ ) and the script is not returning the correct data. I am
> looking for some easy way to determine what is wrong.
>
> Thanks !
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Echo's throughout the code isn't a bad way. You can also utilize print_r()
and exit() and other things. Really the idea is to set break points, and
return data to you that is useful for killing the bug. Its not something
that you can simply so "Do it like this", as there is really rules to how
you should debug really. Just basic deductive reasoning, and some ful
information along the way.

Do you use an IDE at all? You may want to check some out with debuggers
built in. That would you out.

--
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month.

"Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life."

  Réponse avec citation
Vieux 29/08/2008, 17h51   #3
Edward Diener
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Debugging PHP scripts

Dan Joseph wrote:
> On Fri, Aug 29, 2008 at 11:33 AM, Edward Diener <eldiener@tropicsoft.com>wrote:
>
>> I am fairly new to PHP. What is the best way of debugging PHP scripts ?
>>
>> I have put in echo statements to tell me what is happening, but perhaps
>> there are better methods.
>>
>> I have a PHP script on a server, which I access from a client side program
>> ( written in C++ ) and the script is not returning the correct data. I am
>> looking for some easy way to determine what is wrong.
>>
>> Thanks !
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>

> Echo's throughout the code isn't a bad way. You can also utilize print_r()
> and exit() and other things. Really the idea is to set break points, and
> return data to you that is useful for killing the bug. Its not something
> that you can simply so "Do it like this", as there is really rules to how
> you should debug really. Just basic deductive reasoning, and some ful
> information along the way.


Understood.

>
> Do you use an IDE at all? You may want to check some out with debuggers
> built in. That would you out.


I am running on the client, and the PHP script is on a server on another
machine. Is there a PHP IDE running from the client which can me in
that sort of situation ? It would really be nice if I could debug in an
IDE from the client side, but I suspect I would need to be running on
the server machine in order to do so. Of course I can try out the script
locally on my client machine and then I would probably be fine. I would
have to duplicate the server directory setup in order to do so.

I have not looked into PHP IDEs at all so far. Any recommendations ?
Thanks !
  Réponse avec citation
Vieux 29/08/2008, 18h13   #4
Dan Joseph
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Debugging PHP scripts

On Fri, Aug 29, 2008 at 11:51 AM, Edward Diener <eldiener@tropicsoft.com>wrote:

> Dan Joseph wrote:
>
>> On Fri, Aug 29, 2008 at 11:33 AM, Edward Diener <eldiener@tropicsoft.com
>> >wrote:

>>
>>

> I have not looked into PHP IDEs at all so far. Any recommendations ? Thanks
> !
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

I'm a little bias towards PhpED (www.nusphere.com),b ut that's because I use
it. There is also PHP Eclipse, and Zend among others.

Do a google search for "php dbg". Its the same debugger that PhpED uses,
that might get you started before you start into IDEs.

--
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month.

"Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life."

  Réponse avec citation
Vieux 29/08/2008, 18h22   #5
Brady Mitchell
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Debugging PHP scripts


On Aug 29, 2008, at 851AM, Edward Diener wrote:
> I have not looked into PHP IDEs at all so far. Any recommendations ?
> Thanks !


Please don't start this up again. Check the "PHP IDE Needed" thread
that has been active for the past several days or search the list
archives.

http://marc.info/?l=php-general

Brady
  Réponse avec citation
Vieux 29/08/2008, 21h31   #6
Al
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Debugging PHP scripts



Edward Diener wrote:
> I am fairly new to PHP. What is the best way of debugging PHP scripts ?
>
> I have put in echo statements to tell me what is happening, but perhaps
> there are better methods.
>
> I have a PHP script on a server, which I access from a client side
> program ( written in C++ ) and the script is not returning the correct
> data. I am looking for some easy way to determine what is wrong.
>
> Thanks !


debug_backtrace() is pretty handy
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 20h12.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12000 seconds with 14 queries