Introduction
The Xdebug extension provides the following features:
- stack and function traces in error messages with:
- full parameter display for user-defined functions
- function name, file name, and line indications
- support for member functions
- memory allocation
- protection for infinite recursions
Xdebug also provides:
- profiling information for PHP scripts
- code coverage analysis
- capabilities to debug your scripts interactively with a debug client
Xdebug Requires PHP 7.2 or Above
At the time of the writing of this document, the Xdebug extension available through PECL requires PHP 7.2 or above. Please review the "Dependencies" section at the bottom of the following page to confirm the currently supported version:
https://pecl.php.net/package/xdebug
Installation Procedure
Via WHM
1. Login to WHM as the root user
2. Navigate to: Home »Software »Module Installers
3. Click on the "Manage" link for PECL
4. Select "ea-php72" or above from the dropdown
5. Click Apply next to the php version dropdown
6. Type the following into the box to the left of the "Install Now" button: xdebug
7. Click the blue "Install now" button
Via Command Line
1. Login to the server via SSH or Terminal as the root user
2. Use the following command to find the locations of your PECL binaries:
# find /opt/cpanel -name pecl | grep bin
/opt/cpanel/ea-php73/root/usr/bin/pecl
/opt/cpanel/ea-php71/root/usr/bin/pecl
/opt/cpanel/ea-php72/root/usr/bin/pecl
3. For each version that you would like to use Xdebug with, issue the following command:
/opt/cpanel/ea-php73/root/usr/bin/pecl install xdebug
Verify Installation
You may use a PHP Info file to verify that the extension has been installed and is enabled: