Re: Debugging PHP scripts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dan Joseph wrote:
On Fri, Aug 29, 2008 at 11:33 AM, Edward Diener <eldiener@xxxxxxxxxxxxxx>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 !

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux