<HTML ><HEAD ><TITLE >Using the Debugger</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="PHP Manual" HREF="index.html"><LINK REL="UP" TITLE="Debugging PHP" HREF="debugger.html"><LINK REL="PREVIOUS" TITLE="Debugging PHP" HREF="debugger.html"><LINK REL="NEXT" TITLE="Debugger Protocol" HREF="debugger-protocol.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-1"></HEAD ><BODY CLASS="sect1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PHP Manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="debugger.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Appendix D. Debugging PHP</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="debugger-protocol.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="sect1" ><H1 CLASS="sect1" ><A NAME="debugger-using" ></A >Using the Debugger</H1 ><P > The internal debugger in PHP 3 is useful for tracking down evasive bugs. The debugger works by connecting to a <SPAN CLASS="acronym" >TCP</SPAN > port for every time PHP 3 starts up. All error messages from that request will be sent to this TCP connection. This information is intended for "debugging server" that can run inside an <SPAN CLASS="acronym" >IDE</SPAN > or programmable editor (such as Emacs). </P ><P > How to set up the debugger: <P ></P ><OL TYPE="1" ><LI ><P > Set up a TCP port for the debugger in the <A HREF="configuration.html#configuration.file" >configuration file</A > (<A HREF="configuration.directives.html#ini.debugger.port" >debugger.port</A >) and enable it (<A HREF="configuration.directives.html#ini.debugger.enabled" >debugger.enabled</A >). </P ></LI ><LI ><P > Set up a TCP listener on that port somewhere (for example <B CLASS="command" >socket -l -s 1400</B > on UNIX). </P ></LI ><LI ><P > In your code, run "debugger_on(<TT CLASS="replaceable" ><I >host</I ></TT >)", where <TT CLASS="replaceable" ><I >host</I ></TT > is the IP number or name of the host running the <SPAN CLASS="acronym" >TCP</SPAN > listener. </P ></LI ></OL > Now, all warnings, notices etc. will show up on that listener socket, <SPAN CLASS="emphasis" ><I CLASS="emphasis" >even if you turned them off with <A HREF="function.error-reporting.html" ><B CLASS="function" >error_reporting()</B ></A ></I ></SPAN >. </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="debugger.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="debugger-protocol.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Debugging PHP</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="debugger.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Debugger Protocol</TD ></TR ></TABLE ></DIV ></BODY ></HTML >