|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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 ! |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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." |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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 ! |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
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." |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
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 |
|
![]() |
| Outils de la discussion | |
|
|