2

I don't know if there is a tool like this for PHP, but I've been using gdb for C lately with great success. I want to be able to set breakpoints and execute a PHP script, then stepping through my functions to check what's going on.

Can this be done with PHP?

If so I'd love some links to tutorials or other resources. I found nothing while Googling.

Hubro
  • 56,214
  • 69
  • 228
  • 381

2 Answers2

2

For the command line there is an excellent tool called phpdbg:

Features

  • Stepthrough Debugging
  • Flexible Breakpoints (Class Method, Function, File:Line, Address, Opcode)
  • Easy Access to PHP with built-in eval()
  • Easy Access to Currently Executing Code
  • Userland API
  • SAPI Agnostic - Easily Integrated
  • PHP Configuration File Support
  • JIT Super Globals - Set Your Own !!
  • Optional readline Support - Comfortable Terminal Operation
  • Remote Debugging Support - Bundled Java GUI
Akram Fares
  • 1,653
  • 2
  • 17
  • 32
1

See here for some tools:

xDebug

http://www.ibm.com/developerworks/library/os-debug/

http://www.tek-tips.com/faqs.cfm?fid=6379

xDebug certainly provides the ability to set breakpoints.

source

Tool for PHP code analysis

Community
  • 1
  • 1
SW4
  • 69,876
  • 20
  • 132
  • 137
  • 2
    Voting this one down. Question specifies **local** debugging using a **command line tool**. Most of your links are about **remote** debugging using **eclipse** from windows. The other links open for such a load of information that I don't even know where to start. Not a very good answer at all. I've already found xDebug, but it seems more like a PHP module for remote debugging than a tool used for local debugging. – Hubro Oct 05 '11 at 19:55