Xdebug

Open Source

by Xdebug

Provided by Xdebug

Not yet rated
Platform
Web
Pricing
Open Source
Account required
No
Ads
None
Last verified
17 hours ago
Developer
Xdebug
Official URL

Overview

Xdebug is an extension for PHP that adds development aids to the language runtime. Its best-known feature, and the subject of this listing, is step debugging: pausing a running script at a chosen line and walking through it from your editor while inspecting what the code is doing.

Xdebug speaks the open DBGp protocol. When a debugging session starts, the PHP side opens a connection to your IDE, by default on port 9003. You switch the feature on by adding debug to the xdebug.mode setting. By default a session only begins when a trigger is present: an environment variable for command-line scripts, or a cookie or request parameter for web pages, which a browser extension can set for you. A call to xdebug_break() in the code also works, and Xdebug can be told to start a session whenever an error or exception occurs. Editors named in the documentation include Visual Studio Code, PhpStorm, NetBeans, Eclipse, Sublime Text and Vim.

The extension is written by Derick Rethans and released under the Xdebug License, which is based on the PHP License. It is free, and is funded by support plans and sponsors. Because PHP must be able to reach the editor over the network, setups involving containers, remote servers or firewalls are where most of the difficulty lies.

Features

  • Step through PHP code line by line from an IDE or editor
  • Uses the open DBGp protocol, connecting to the IDE on port 9003 by default
  • Sessions started by environment variable, cookie or request parameter
  • xdebug_break() starts a session or acts as a breakpoint from code
  • Option to start a session when a warning, notice or exception occurs
  • Works with Visual Studio Code, PhpStorm, NetBeans, Eclipse, Sublime Text, Vim and others
  • Bundled dbgpClient command-line debugger
  • Same extension also provides tracing, profiling, code coverage and richer error output

Privacy

See the official privacy policy. Xdebug runs inside your own PHP installation and connects only to the editor you configure; the optional paid Xdebug Cloud service relays sessions through the project's servers.

Pros & Cons

Pros

  • Free and open source
  • Supported by most PHP editors through one shared protocol
  • Debugs both web requests and command-line scripts
  • Trigger-based start means it stays quiet until you ask for it

Cons

  • Network setup can be fiddly with containers, remote servers and firewalls
  • The short default connection timeout can drop sessions on slow networks
  • The option that discovers the client host lets anyone who can reach the server start a session, so it is not for public servers
  • It is a development tool and is not meant to be left enabled on production servers

Community Reviews (0)

No written reviews yet — be the first to rate this tool.

Similar Tools

  • Debuggers · HTTP Toolkit

    Intercepts, debugs, and mocks HTTP(S) traffic.

    Not yet rated
    Freemium Windows Linux
  • Debugs and inspects web pages directly in the browser.

    Not yet rated
    Free Windows Linux
  • Debuggers · LLDB

    Debugs C, C++, and Objective-C programs.

    Not yet rated
    Open Source Windows Linux