Connecting Tech Pros Worldwide Forums | Help | Site Map

Conceptual gap in debugging PHP

Dale
Guest
 
Posts: n/a
#1: Jul 21 '05
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 1.2.3.159 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:
extension=php_dbg.dll

;;;;;;;;;;;;;;;;;;;;;
; Debugger Settings ;
;;;;;;;;;;;;;;;;;;;;;
[debugger]
debugger.enabled=on
debugger.profiler_enabled=on
debugger.hosts_allow=localhost
debugger.hosts_deny=ALL
debugger.ports=7869, 10000/16

I restarted Apache.

I wrote the following script in PHPEdit:
<?php
debugger_on(localhost);
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
launched

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...


Tony Marston
Guest
 
Posts: n/a
#2: Jul 21 '05

re: Conceptual gap in debugging PHP



"Dale" <dale.drinkard@gmail.com> wrote in message
news:1121876196.453035.186810@g14g2000cwa.googlegr oups.com...[color=blue]
> 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 1.2.3.159 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:
> extension=php_dbg.dll
>
> ;;;;;;;;;;;;;;;;;;;;;
> ; Debugger Settings ;
> ;;;;;;;;;;;;;;;;;;;;;
> [debugger]
> debugger.enabled=on
> debugger.profiler_enabled=on
> debugger.hosts_allow=localhost
> debugger.hosts_deny=ALL
> debugger.ports=7869, 10000/16
>
> I restarted Apache.
>
> I wrote the following script in PHPEdit:
> <?php
> debugger_on(localhost);
> 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
> launched
>
> 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...[/color]

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:
extension=php_dbg.dll-5.0.3
(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
options.

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

http://www.tonymarston.net



Dale
Guest
 
Posts: n/a
#3: Jul 21 '05

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,,,,

Closed Thread