Xdebug — Step Debugger and Debugging Aid for PHP
.. image:: https://github.com/xdebug/xdebug/workflows/Build/badge.svg :target: https://github.com/xdebug/xdebug/actions?query=workflow%3ABuild .. image:: https://ci.appveyor.com/api/projects/status/glp9xfsmt1p25nkn?svg=true :target: https://ci.appveyor.com/project/derickr/xdebug .. image:: https://circleci.com/gh/xdebug/xdebug/tree/master.svg?style=svg :target: https://circleci.com/gh/xdebug/xdebug
Xdebug is a debugging tool for PHP. It provides step-debugging and a whole range of development aids, such as stack traces, a code profiler, features to dump the full execution of your script to a file, and more.
Xdebug requires a
supported version_ of PHP. For installation it requires the
pecltool (available through the
php-pearpackage), unless your Linux distribution has an Xdebug package (
On most Linux distributions you can install Xdebug through its package manager. You can also compile from source with the
pecl install xdebug. The latter also works for MacOS as long as PHP is installed with Homebrew.
On Windows, you need to
download_ a binary. Use the
Unless you have installed Xdebug with a package manager on Linux, you also need to add the following line to your
php.inifile, or create a new Xdebug specific ini file
conf.ddirectory. In either case, it needs the following line added::
For more extensive installation instructions, see the documentation at https://xdebug.org/docs/install
Most features in Xdebug have to be opted in into. Each feature has a specific opt-in. For example to use the
step debugger_ you need to set
xdebug.remote_enable=1in your configuration file. The step debugger requires an IDE (client), of which there are many
The documentation has instructions for each of Xdebug's features: https://xdebug.org/docs/ and a full list of
settings_ is also available there.
Xdebug is written in C, and extensive knowledge of PHP's internals is necessary to be able to contribute. Contributing guidance is available
Before you begin to contribute, please reach out first. Either through email (address at the bottom), an issue in the
issue tracker_ or preferably through IRC on Freenode's #xdebug channel.
If you are familiar with compiling PHP extension from source, have a local checkout of Xdebug's GitHub repository, and have compiled Xdebug in that directory following the instructions under
installation_ you can run Xdebug's tests by running::
The test framework requires that the PHP binary on the path has Xdebug loaded, with remote debugging enabled through
xdebug.mode=debug. It is possible to skip remote debugging tests by exporting the
SKIP_UNPARALLEL_TESTS=1can be used to skip tests that can not run in parallel environments, and the
SKIP_SLOW_TESTS=1environment variable to skip slow tests. The
OPCACHEenvironment variable can either be
noand controls whether the test framework enables or disables OpCache.
Xdebug is released under
The Xdebug License, which is based on
The PHP License. It is an Open Source license (though not explicitly endorsed by the Open Source Initiative).
Xdebug has extensive documentation on its
website_. There are over a hundred settings and many functions documented. Please have a look through the wealth of information that Xdebug can provide to make your every day development with PHP easier.
For questions regarding Xdebug, please use
StackOverflow_, and tag your question with
You can also find ad-hoc and sporadic support on IRC:
freenode/#xdebug. You can do that with your favourite client, or by using their
If you think that you encountered a bug, please file a detailed bug report at https://bugs.xdebug.org. You are required to create an account, this is so that you can be contacted for additional information and to keep out spam.
Derick Rethans — [email protected]