Re: Debugging PHP scripts

From: Date: Fri, 29 Aug 2008 15:51:52 +0000
Subject: Re: Debugging PHP scripts
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-278976@lists.php.net to get a copy of this message
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 helpful 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 help 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 help 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 !

« previous php.general (#278976) next »