Forum Moderators: coopster

Message Too Old, No Replies

Are there PHP debuggers available with step-through functionality?

         

smithaa02

3:18 pm on Feb 28, 2008 (gmt 0)

10+ Year Member



I frequently work with third party software that is quite complicated with code spread out over many pages, functions, and classes, and it would be nice when I'm trying to fix a bug or tweak some functionality if there were some PHP debugging trick available that would allow me to follow each line of code as it is executed while I surf that website.

I know in linux, you can find the PID of your thread and fill that into strace, but the results are often too technical. Is there an equivalent trace/step trick for PHP?

coopster

5:40 pm on Feb 28, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



There are editors available with these features. For example, Eclipse is an open source editor that has a PHP Debug perspective that allows you to add breakpoints, monitor, etc.

smithaa02

5:51 pm on Feb 28, 2008 (gmt 0)

10+ Year Member



But those are editors (I assume) that are run on the client side. For some of these PHP apps I use they are installed directly on the server and use local server information (like basedirs, local DB's, etc) to function.

Are you aware of any debuggers that can be run and installed on the server instead?

steve

9:51 am on Feb 29, 2008 (gmt 0)

10+ Year Member



Xdebug installs on the server and works with a range of clients such as eclipse, php designer, etc.

Zend also offer a similar module which works with Zend Studio, it can also be controlled with the Zend Studio toolbar for IE or FF.

jabez

10:13 pm on Mar 21, 2008 (gmt 0)

10+ Year Member



If you want to be able to debug PHP code, then you need a copy of the PHP source code, for the debugger to give you some sort of intelligent output as to what line you are debugging. As far as I know it is not possible to debug somebody else's PHP code. Don't forget once PHP code has been output to a browser by the server, all you will get is the (x)html code that PHP passes along to the web-server.

Here is a nice Linux based PHP debugger that will do all you want it to, provided you have access to the PHP source code, and a PHP debugger module is installed and setup on the server.

[sourceforge.net...]

sache

2:55 pm on Mar 24, 2008 (gmt 0)

10+ Year Member



Also you can use DBG [dd.cron.ru...] on the server in combination with Eclipse, for free.
There is also a commercial version of the same debugger integrated in PhpED.

Also, if you want a quick solution to do debugging in PHP try this free solution from Zend an Eclipse:
[zend.com...]
The "all in one package" worked in an instant for me.