Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This document explains to you

Redirect
locationhttps://www.jetbrains.com/help/phpstorm/configuring-xdebug.html
delay2

Include Page
Social Buttons PhpStorm
Social Buttons PhpStorm

 

Note
iconfalse

This tutorial explains how to install Xdebug extension to your

...

web server and prepare it to be used for

...

debugging with PhpStorm IDE.

...

 

Downloading, Installing and Configuring the Xdebug Extension

...

  1. Download the Xdebug extension compatible with your PHP version (mind the PHP version number and thread-safe/non-thread-safe option) from the official site. These instructions are based on the latest version in the 2.x release of Xdebug.
  2. Copy the extension file to your Web web server in a location that is accessible by the Web web server.
  3. Add the following lines at the end of your php.ini file:

    Code Block
    [Xdebug]

    
    zend_extension=<full_path_to_xdebug_extension>
    xdebug.remote_enable=1
    xdebug.remote_host=<the host where PhpStorm is running (e.g. localhost)>
    xdebug.remote_port=<the port to which Xdebug tries to connect on the host where PhpStorm is running (default 9000)>
    
    Note
    titleNote

    Since PHP 5.3, you always need to use the 'zend_extension', and not NOT 'zend_extension_ts', 'zend_extension_debug' or 'extension'.

  4. Restart your Web server
  5. Check your installation:
    1. Create a file with the following content:

      <?php
      phpinfo();
      ?>

    2. Open a page corresponds to this file and check phpinfo() output. It should contain Xdebug section:
      Image Removed

Configuring debugger

Add the following lines to the 'Xdebug' section of your php.ini file:

xdebug.remote_enable=1
xdebug.remote_host=<the host where PhpStorm is running>
xdebug.remote_port=<the port to which Xdebug tries to connect on the host where PhpStorm is running>

  1. Info

    The value of 'xdebug.remote_host' can be a host name

...

  1. (e.g. localhost) or an IP address.

...

  1. Info

    The value of 'xdebug.remote_port' is usually 9000. It is default value in Xdebug and PhpStorm. Ensure that the specified port is opened on your client machine.

...

  1. For additional information check http://xdebug.org/docs/remote

  2. Restart your web server
  3. Check your installation:
    1. Execute in the terminal

      Code Block
      php --version

      Image Added

    2. Or create a file with the following content:

      Code Block
      <?php
      phpinfo();
      
    3. Open a page corresponds to this file and check phpinfo() output. It should contain Xdebug section:
      Image Added

Once you've installed and configured Xdebug, you can use the Validating Your Debugging Configuration tool to confirm that the configuration of Xdebug and PhpStorm are compatible. 

Include Page
Social Buttons PhpStorm
Social Buttons PhpStorm