Conceptual gap in debugging PHP

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Windows XP, Apache 2.0.54, PHP 5.0.4, MySQL 4.1
running on my local machine

I want to migrate to more sophisticated debugging: setting breakpoints,
watching variables, step into/over, etc.

I installed PHPEdit and discovered I have to install a
separate debugger.  I downloaded dbg-2.11.32-win32-php5, copied the
file php_dbg.dll.5.0.3 to c:\php5\ext\php_dbg.dll  (I realize I'm
running 5.0.4 but 5.0.3 appears to be the latest dbg dll)

I update my php.ini file by including the following lines:

; Debugger Settings ;
debugger.ports=7869, 10000/16

I restarted Apache.

I wrote the following script in PHPEdit:
echo "hello world";

When I click the "Run script with debugger" button I get:
An internal error has occured with code 0; Check if DBG listner is

I clicked debug->Start Listner (nothing obvious happened).

* I have read all the help with PHPEdit and I cannot find a simple
example.  Am I missing the boat completely?  Do I browse to the php
file and the debugger "springs" into action?  Am I dreaming to think
you can do with PHP what I'm use to using my Borland C++ Builder?  Do I
need to start drinking *before* noon?

Many thanks...

Re: Conceptual gap in debugging PHP

Quoted text here. Click to load it

I have been using PHPEdit for several years now, so here are some tips:
(1) Copy php_dbg.dll-5.0.3 to the php5/ext directory
(2) Modify your php.ini file to enable this extension thus:  
(3) Start PHPEdit. Select Debugger->Debugger Settings. In the tab at the  
bottom marked 'HTTP' set the following:
- HTTP server root URL: http://localhost/
- Local root directory: C:/Apache2/HTDOCS (or whatever you have called it)
- Remote root directory: (same as above)
(4) When you want to start debugging a script that you are running from your  
web browser you must insert a debugbreak() command. This will activate the  
debugger when it hits that line. You can then use the step in/out/over  

The debugger should be installed automatically when you install PHPEdit, and  
when you start PHPEdit it should automatically start the listener which  
inserts a little icon (a radio dish) into the system tray.

Hope this helps.

Tony Marston

Re: Conceptual gap in debugging PHP

Think I got it!

The trick was that, as Tony pointed out, an install tree of php.5.0.3
came with the installation.  I just changed my apache config file to
load that php, rather than the 5.0.4 that I had installed, made a few
changes to the php.ini file, and it seems to be working.

Many Thanks,,,,

Site Timeline