Skip to content

Instantly share code, notes, and snippets.

@Justintime50
Created May 23, 2021 05:30
Show Gist options
  • Save Justintime50/47098d612226ff8ebfc439c0a8c226c7 to your computer and use it in GitHub Desktop.
Save Justintime50/47098d612226ff8ebfc439c0a8c226c7 to your computer and use it in GitHub Desktop.
Learn how to install PHP's Xdebug on macOS.

Install Xdebug on macOS

Installing Xdebug on macOS has changed a lot through the years. The most recent workflow to accomplish this is as follows:

# Install PHP
brew install php
# brew install [email protected]

# Install GNU `sed` and `grep`, installer will fail without them
brew install grep
brew install gnu-sed

# Install Xdebug
pecl install xdebug

# Verify Xdebug Installation
php --version

Output

PHP 7.4.19 (cli) (built: May 13 2021 06:28:47) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans
    with Zend OPcache v7.4.19, Copyright (c), by Zend Technologies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment