79103369

Date: 2024-10-18 19:06:51
Score: 0.5
Natty:
Report link

A working xdebug extension for Apple Silicon was found and installed using using the following command.

arch -arm64 sudo pecl install xdebug

This installed xdebug to my local machine's php (not MAMP's), so more was needed to get it to work in MAMP. I was incorrect about the php.ini file pertaining to Apache only; I edited the MAMP php.ini file for the php version I am working with, and removed the comment character from the zend-extension rule. I then had to change the xdebug.so location from its default to the location the xdebug install utility echoed back:

/opt/homebrew/Cellar/php/8.3.12_1/pecl/20230831/xdebug.so

After that, the VSCode debugger properly halted on breakpoints. There doesn't seem to be a single source of information on how to do this for Apple Silicon, so I hope this may help others.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: K Cowles