PHP: The PHP Debugger - Manual
PHP  
downloads | documentation | faq | getting help | mailing lists | | php.net sites | links | my php.net 
search for in the  
<그밖의 비호환성들디버거 프로토콜(Debugger Protocl)>
view the version of this page
Last updated: Wed, 29 Jan 2003

부록 C. The PHP Debugger

디버거 사용기

PHP의 내부 디버거는 알수없는 다운 버그들에 유용하다. 이 디버거는 PHP가 작동하는 동안 내내 TCP 포트에 접속해서 작업된다. 요청(Request)는 TCP접속에 보내서 모든 에러 메세지가 나온다. IDE나 Progrmmable 에디터 안에서 실행되는 "디버깅 서버(Debugging server"의 강제적인 정보이다(Emacs처럼).

디버거 설치하는 방법:

  1. 디버거를 위한 TCP 포트 설치는 configuration file안에 있다. (debugger.port)과 가능설정 (debugger.enabled)

  2. 어딘가의 포트에서 TCP 감시자(lestener) 설치 (예를 들어 socket -l -s 1400 on UNIX).

  3. 당신의 코드에서 하고, TCP 감시자(listener)가 실해되는 동안 host는 IP 숫자와 호스트의 이름을 가진 host에서 "debugger_on(host)"을 실행.

모든 경고는 감시자 소켓(listener socket)는 공지된다. 비록 error_reporting()에 의해 꺼져있더라도.

참고: 디버거를 위한 코드 PHP4에서는 제공되지 않는다. 이것은 PHP3에서만 제공된다.



User Contributed Notes
The PHP Debugger
add a note add a note
cbarnett at crossbeam dot com
08-Jul-2000 03:22

I'm copying this note from a post I found on Geocrawler.  I think Thierry diserves a round of applause for actually posting something useful, so...

HooRah!!!!

I'm going to add some syntax highlighting to the code to make it cute, and then we'll see.

FROM: Thierry Boudet
             DATE: 12/01/1998 01:35:21
             SUBJECT: RE:  [PHP3] [php3] get the debug info
             

             Rui Barreiros a �crit:
             >
             > how can i get the debug info that the php3 sends to port 2000 (in my
             > case)
             >

            =====================================================================
            #!/usr/bin/perl -w

             use Socket;
           $port = 7869;           # PHP debugger
             my $proto = getprotobyname('tcp');

             socket(Server, PF_INET, SOCK_STREAM, $proto)
                                        or die "socket: $!";
             setsockopt(Server, SOL_SOCKET, SO_REUSEADDR, pack("l",1))
                                      or die "setsockopt: $!";
            bind(Server, sockaddr_in($port, INADDR_ANY))
                                      or die "bind: $!";
            listen(Server, SOMAXCONN);

             for ( ; $paddr = accept(Client, Server); close Client)
                 {
                my ($port, $iaddr) = sockaddr_in($paddr);
                my $name = gethostbyaddr($iaddr, AF_INET);
                 print "-------------  $name  $port --------";
                while (<Client>)        {  print;   }
                 }
            =====================================================================

jruskiewicz at techtracker dot com
26-Sep-2000 08:19

[Ed: Note: Python loop control is managed through indentation, so you will need to reindent this errata note]
python remote debug listener...

#!/usr/bin/python
#Used for remote debugging of PHP programs.
from socket import *;

#connect and bind to the port
s = socket(AF_INET, SOCK_STREAM);
s.bind("",7869);
s.listen(5);

#little info to print out
print "PHP Remote Debug Application";

#let us try this thing...
try:
while 1:
client, addr = s.accept();
tmp = client.recv(1024);
while tmp:
print tmp, "\n";
tmp = client.recv(1024);
client.close();
except:
s.close();
print "Exit";

bob at bobbydigital dot fsnet dot co dot uk
27-Oct-2000 12:12

want a simple way to get errors from php?

from the command line simply type:

"/path-to-php/php.exe your-php-file.php3"

and It'll throw back useful errors

use -q option before the filename to Suppress HTTP Header output.

steve at stevedix dot de
09-Mar-2001 02:05

There is actually a symbolic debugger for php4 : BIKE.

It only works on unix/linux, and is a bit limited, but it's better than the existing (rather limited) system and typing tons of echos.

See it at :


dima at NOSPAM dot kde dot org
17-Jun-2001 03:46

Both php3 and php4 ( dbg extention ) are supported by Quanta Plus ( )

It's a full featured IDE for Unix ( KDE )
which supprt PHP too.

23-Aug-2002 06:51
check out this great, cross-platform, my favourite php debugger:


it not only allows "debugging PHP programs locally or remotely, including debugging in CGI or other Web Server API environments", but, besides, is a full fledged Perl, PHP, Python, Tcl, and XSLT IDE. based on mozilla.

current version 1.2.9 costs some money ($29.50 non commercial), previous version 1.1 is free (non commercial).

joe_fitchnospam at hotmail dot com
17-Dec-2002 07:15

I've tried many debuggers and PHP IDEs including Zend IDE, Komodo, PHPEdit, PHPEd and Maguma Studio.
After all I'm sure that the best one debugger is dbg. It supports breakpoints even conditional ones,  all kind of steps throu php code, watch etc, so it's a fully functional debugger indeed and profiler too. Fortunately, it's an open-source product as PHP itself. Unfortunately, it does not contain any front-end, but 3rd party PHP IDEs. Seems, as for an IDE the best one is PHPEd 3.1 (), former PHP IDE from Ergin Soysal.
I was also deeply impressed with IonCube accelerator performance (). Commercial version of IONCUBE is many times faster than the commercial one from Zend (www.zend.com). Huh ?
Hope this info would help someone to find the better way faster.

tulpe at atomar dot de
07-Feb-2003 02:09

Tired of manualy printing out your variables and arrays for debugging?

Take a look at my debuglib at:



Happy debugging!

Thomas Sch��ler

add a note add a note

<그밖의 비호환성들디버거 프로토콜(Debugger Protocl)>
 Last updated: Wed, 29 Jan 2003
show source | credits | mirror sites 
Copyright © 2001-2003 The PHP Group
All rights reserved.
This mirror generously provided by: /
Last updated: Wed May 21 21:10:23 2003 CEST