Installing Xdebug with Laravel Herd


August 24th, 2023

Installing Xdebug with Laravel Herd

Herd does not ship with Xdebug out of the box, but you can manually install and compile the Xdebug PHP extension via Homebrew and pecl.

Here are the instructions:

First Install php via Homebrew:

brew install php

Next, pecl install Xdebug

pecl install xdebug

This creates an extension file that you can now activate and use with Laravel Herd.

On an M1/M2 Mac, the extension can be fount at /opt/homebrew/lib/php/pecl. On an Intel Mac, it will be at /usr/local/lib/php/pecl.

Finally, activate Xdebug

You may activate Xdebug by editing your php.ini file. This file is located at ~/Library/Application Support/Herd/config/php/<version>/php.ini..

# Absolute path to the file
# Enable Xdebug

Please read the official instructions for more information, and thanks to BeyondCode for this great app.

Filed in:

Eric L. Barnes

Eric is the creator of Laravel News and has been covering Laravel since 2012.