Need help with xdebug?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

xdebug
2.4K Stars 499 Forks Other 5.2K Commits 6 Opened issues

Description

Xdebug — Step Debugger and Debugging Aid for PHP

Services available

!
?

Need anything else?

Contributors list

# 24,503
PHP
C
MongoDB
templat...
3879 commits
# 243,313
Shell
PHP
C
80 commits
# 189,711
PHP
Shell
C++
37 commits
# 189,609
C#
c-sharp
memory-...
.NET
29 commits
# 12,352
PHP
Redis
php7
yaf
17 commits
# 22,580
PHP
C
rpc-fra...
kafka
13 commits
# 108,514
PHP
ecommer...
php-fra...
semapho...
8 commits
# 19,514
PHP
C
phalcon
Shell
7 commits
# 42,756
PHP
Symfony
memory-...
php7
6 commits
# 94,777
PHP
C
Shell
mqtt-cl...
5 commits
# 14,904
Perl
malloc
unix
vulkan
4 commits
# 19,252
Jupyter...
Common ...
Haskell
kafka
4 commits
# 11,043
C
Android
php5
memcach...
3 commits
# 538
Symfony
php-fra...
php7
servers
3 commits
# 11,898
PHP
php7
pmd
Symfony
3 commits
# 315,336
PHP
vscode
xdebug
aspect-...
2 commits
# 6,001
PHP
Symfony
Compose...
phpstor...
2 commits
# 97,563
PHP
Symfony
sql-edi...
Clojure
2 commits
# 38,735
Shell
phpstan
Less
Bootstr...
2 commits
# 14,259
PHP
Symfony
php-fra...
flex
2 commits

Xdebug

.. 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.

Requirements

Xdebug requires a

supported version 
_ of PHP. For installation it requires the
pecl
tool (available through the
php-pear
package), unless your Linux distribution has an Xdebug package (
php-xdebug
).

Installation

On most Linux distributions you can install Xdebug through its package manager. You can also compile from source with the

pecl
tool through
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
Wizard 
_.

Unless you have installed Xdebug with a package manager on Linux, you also need to add the following line to your

php.ini
file, or create a new Xdebug specific ini file
xdebug.ini
in the
conf.d
directory. In either case, it needs the following line added::
zend_extension=xdebug

For more extensive installation instructions, see the documentation at https://xdebug.org/docs/install

Configuration

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=1
in your configuration file. The step debugger requires an IDE (client), of which there are many
available 
_.

The documentation has instructions for each of Xdebug's features: https://xdebug.org/docs/ and a full list of

settings
_ is also available there.

Contributing

Xdebug is written in C, and extensive knowledge of PHP's internals is necessary to be able to contribute. Contributing guidance is available

separately 
_.

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.

Testing

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::
php run-xdebug-tests.php

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_DBGP_TESTS=1
environment variable.

The

SKIP_UNPARALLEL_TESTS=1
can be used to skip tests that can not run in parallel environments, and the
SKIP_SLOW_TESTS=1
environment variable to skip slow tests. The
OPCACHE
environment variable can either be
yes
or
no
and controls whether the test framework enables or disables OpCache.

Licensing

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).

Further Reading

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.

Support

For questions regarding Xdebug, please use

StackOverflow
_, and tag your question with
xdebug
.

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
webchat
_.

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]

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.