<HTML ><HEAD ><TITLE >The PHP Debugger</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.44"><LINK REL="HOME" TITLE="PHP Manual" HREF="manual.html"><LINK REL="UP" TITLE="Appendixes" HREF="appendixes.html"><LINK REL="PREVIOUS" TITLE="Reporting Errors" HREF="phpdevel-errors.html"><LINK REL="NEXT" TITLE="Debugger Protocol" HREF="debugger-protocol.html"></HEAD ><BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><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="phpdevel-errors.html" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="debugger-protocol.html" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="appendix" ><H1 ><A NAME="debugger" >Appendix C. The PHP Debugger</A ></H1 ><DIV CLASS="TOC" ><DL ><DT ><B >Table of Contents</B ></DT ><DT ><A HREF="debugger.html#debugger-using" >Using the Debugger</A ></DT ><DT ><A HREF="debugger-protocol.html" >Debugger Protocol</A ></DT ></DL ></DIV ><DIV CLASS="sect1" ><H1 CLASS="sect1" ><A NAME="debugger-using" >Using the Debugger</A ></H1 ><P > PHP's internal debugger is useful for tracking down evasive bugs. The debugger works by connecting to a <SPAN CLASS="acronym" >TCP</SPAN > port for every time PHP 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.html#ini.debugger.port" >debugger.port</A >) and enable it (<A HREF="configuration.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, <I CLASS="emphasis" >even if you them turned off with <A HREF="function.error-reporting.html" ><B CLASS="function" >error_reporting()</B ></A ></I >. </P ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="phpdevel-errors.html" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="manual.html" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="debugger-protocol.html" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Reporting Errors</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="appendixes.html" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Debugger Protocol</TD ></TR ></TABLE ></DIV ></BODY ></HTML >