PHP  
downloads | documentation | faq | getting help | | php.net sites | links 
search for in the  
previousOther incompatibilitiesUsing the Debuggernext
Last updated: Tue, 28 May 2002
view this page in Printer friendly version | English | Brazilian Portuguese | Czech | Dutch | French | German | Hungarian | Italian | Japanese | Korean | Polish | Romanian | Russian | Spanish | Turkish

Liite D. Debugging PHP

About the debugger

PHP 3 includes support for a network-based debugger.

PHP 4 does not have an internal debugging facility. You can use one of the external debuggers though. The includes a debugger, and there are also some free debugger extensions like DBG at or the (APD).

User Contributed Notes
Debugging PHP
add a note about notes

24-Aug-1999 10:06

 --
PHPEd, also listens the port. Besides, captured messages are interpreted,
and editor takes you to line where the reported error occured.


08-Jul-2000 02: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;   }
                  }
             
=====================================================================


26-Sep-2000 07: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";


27-Oct-2000 11: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.


09-Mar-2001 01: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 : 


06-Apr-2001 12:26
Hi, 
under this address you will find a good featured debuger for PHP .
It is supposed to work together with  and
also with MS Visual Studio.

Hoping that it helps Patrick Wolf


17-Jun-2001 02: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.

add a note about notes
previousOther incompatibilitiesUsing the Debuggernext
Last updated: Tue, 28 May 2002
show source | credits | stats | mirror sites:  
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by:
Last updated: Thu Jul 4 00:07:12 2002 CEST