Open /opt/homebrew/etc/php/8.0/php.ini file and append the following lines(if not already present): zend_extension="xdebug.so" opt/homebrew/etc/php/8.0/conf.d/php-memory-limits.ini opt/homebrew/etc/php/8.0/conf.d/ext-opcache.ini, ini files parsed: /opt/homebrew/etc/php/8.0/conf.d/error_log.ini, ini files in: /opt/homebrew/etc/php/8.0/conf.dĪdditional. Loaded Configuration File: /opt/homebrew/etc/php/8.0/php.ini The output should look similar to this: Configuration File (php.ini) Path: /opt/homebrew/etc/php/8.0 Run the following command to find the location of php.ini file php -ini
Locate php.ini and append Xdebug configuration: If the output contains Xdebug - the PECL updated your php.ini then you are done. With Zend OPcache v8.0.17, Copyright (c), by Zend Technologies With Xdebug v3.1.3, Copyright (c) 2002-2022, by Derick Rethans Zend Engine v4.0.17, Copyright (c) Zend Technologies You should see output like this: PHP 8.0.17 (cli) (built: 09:45:09) (NTS) Or if PHP was compiled for x86_64 architecture, then run this command: arch -x86_64 sudo pecl install xdebug In the terminal enter the following command: /bin/bash -c "$(curl -fsSL )"įollowing command will get you the most recent PHP version: brew install phpĬhoose which command to run depending on your Mac architecture:Īpple M1 arch -arm64 sudo pecl install xdebug The rest of the document will explain this approach. We have prepared a detailed step-by-step tutorial on how to do that. There are multiple ways how to install Xdebug on macOS: To debug PHP applications with PHP Tools for Visual Studio Code, it is necessary to install and enable Xdebug extension.