← lessons

Install Xdebug with PECL

Video Lesson: Install Xdebug with PECL

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

Mark Shust

TEACHER

Mark Shust

Published 3 months ago

Share with colleagues:

Share on X Share on LinkedIn

Lesson Content

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!

Welcome University student! You have extended access.

Learn more about this topic in the Magento 2 Coding Kickstart course:

View course →

Want to learn more about this topic?

It's covered in great detail within the Magento 2 Coding Kickstart course.

View course →
M Bytes Newsletter
Bi-weekly Magento deep-dives

Watch. Read. Apply. One topic every other week.

Fresh bytes every other Thursday. No spam. Unsubscribe anytime.


Join 9,000+ developers learning Magento, one byte at a time.