Php - Xdebug

> Procedural Languages > Php

1 - About

Xdebug is a php debugger

The debug configuration can be found at All settings doc

Advertising

3 - Configuration

3.1 - Downlaad Xdebug

  • Go to the wizard
  • Fill in the output of php -í
  • Download the advised Dll

3.2 - Php.ini

The important configuration parameters are:

  • xdebug.remote_enable to enable the debugger
  • xdebug.remote_host and xdebug.remote_port to define where the debugger should connect to.

Add the following lines in php.ini (for Php 5.3 and higher):

[Xdebug]
zend_extension=<path to php_xdebug.dll>
xdebug.remote_enable=1
xdebug.remote_port=<the port where Xdebug will send the debug data> (the default port is 9000)
xdebug.remote_host =<the hostname where Xdebug will send the debug data>
xdebug.profiler_enable=1
xdebug.profiler_output_dir=<AMP home\tmp> (AMP=Apache, MySQL, PHP)

3.3 - Docker

In a docker environment, the host ip can be found in docker network settings:

zend_extension='D:\xampp\php\ext\php_xdebug-2.4.0-5.6-vc11.dll'
xdebug.remote_enable=1
xdebug.remote_host = 10.0.75.1
xdebug.remote_port=9000
xdebug.profiler_enable=1
xdebug.profiler_output_dir=  D:\xampp\php\tmp/

Advertising