Install Xdebug with PECL
Learn how to install Xdebug using PECL, the PHP Extension Community Library.

Fresh bytes every Thursday. No spam, ever. Unsubscribe anytime.
Join 9,000+ developers and get three free video lessons every week.
PECL, also known as the PHP Extension Community Library, is the easiest way to install Xdebug. It will download Xdebug's source code, compile it, and install it in the correct location for your PHP installation.
We can easily install Xdebug with PECL by running:
pecl install xdebug
Important note: During installation, PECL will ask you if you want to add "extension=xdebug.so" to
php.ini
file. It's important that we just press Enter to skip this, as adding this line manually can cause some problems down the line.
After the installation completes, let's verify that Xdebug was properly installed and enabled by running:
php -v
You should then see Xdebug mentioned in the output:
PHP [PHP_VERSION] (cli) (built: [PHP_BUILD_DATE]) (NTS)
Copyright (c) The PHP Group
Zend Engine [ZEND_VERSION], Copyright (c) Zend Technologies
with Xdebug [XDEBUG_VERSION], Copyright (c) [XDEBUG_COPYRIGHT_YEAR], by [XDEBUG_AUTHOR]
You are looking specifically for the "with Xdebug" line. If it exists, Xdebug is installed and enabled, and you should be all set to start debugging!