There is a bug for this. The link is thus: https://bugs.xdebug.org/view.php?id=1593
Which describes that you need to use Xdebug 2.7.0beta1 for now.
Answer from Hannibal on Stack OverflowThere is a bug for this. The link is thus: https://bugs.xdebug.org/view.php?id=1593
Which describes that you need to use Xdebug 2.7.0beta1 for now.
Hannibal is correct, but his answer is a bit terse so I want to expand on it a bit.
This is a XDebug bug for PHP 7.3.x so you'll need to install XDebug 2.7.0beta1:
$ pecl install xdebug-2.7.0beta1
Since I installed the latest PHP version using Homebrew, the XDebug installation actually threw two mkdir() errors. This was because there was already a pecl symlink in Homebrew's PHP directory.
First I wanted to verify that, so I ran $ ls -al /usr/local/Cellar/php/<YOUR_PHP_VERSION_NUMBER>
If you have any doubt about your PHP version, it should be in the pecl installation log and listed right alongside the mkdir() errors.
Once I confirmed that there was already a symlink there, I simply removed it:
$ rm /usr/local/Cellar/php/<YOUR_PHP_VERSION_NUMBER>/pecl
After I did that, I ran the install again and it worked smoothly.
Of course, $ php --ini showed errors, so I had to configure PHP properly. Gabor Javorsky actually wrote a great article which includes how to ensure XDebug gets loaded correctly and it worked perfectly for me. See Step 2 in his article here: https://javorszky.co.uk/2018/05/03/getting-xdebug-working-on-php-7-2-and-homebrew/.
Don't forget to reload PHP after tweaking your config, which for me was:
$ brew services stop [email protected] && brew services start [email protected]
After that, $ php --ini should show no errors!