Installing XDebug On Windows

21st August 2008 - 2 minutes read time

XDebug is an excellent debugging solution that will give you a more detailed indication of what is wrong in your code. Here is an example of trying to divide two variables that have a value of 0.

  1. Get XDebug (RC3) to match my php (Windows, 5.1.4) – http://xdebug.org
  2. Put it into a directory that you can remember, for example, I put it into my PHP directory at C:\php5\
  3. Open your php.ini file and enter the following lines. If the zend_extension_ts value has been set elsewhere then comment this out.
    1. [xdebug]
    2. xdebug.remote_enable=1
    3. xdebug.remote_host="localhost"
    4. xdebug.remote_port=9000
    5. xdebug.remote_handler="dbgp"
    6. zend_extension_ts="C:\php5\php_xdebug-2.0.3-5.2.5.dll"
  4. Restart your Apache server and run phpinfo() to see if the instillation has taken.

You will now be able to see detailed output for each of your errors.

Remember that these errors still follow the same rules as normal errors. You must still turn on the display_errors directive and set the appropriate error reporting level to get PHP to display any errors at all.

Add new comment

The content of this field is kept private and will not be shown publicly.