Hello Larry,
Thank you for the information. We will need a separate tutorial for Mac setup.
"zhs: command not found: php" tells us there isn't PHP in the PATH. That indicates something is wrong with XAMPP installation since that's precisely what XAMPP should do. You should not need to install PHP in parallel, otherwise, you could just install it yourself like this https://docs.devsense.com/en/vscode/debug/xdebug-mac - btw. and it might be even easier path.
If you want to continue with XAMPP, check if this is in the PATH?
/Applications/XAMPP/xamppfiles/bin
Did you check XAMPP Developer Files when installing the XAMPP?
If not, try to reinstall it with this option checked.
You will need to install homebrew (https://brew.sh/)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
and then install other tools:
brew install autoconf automake libtool
Then you will need to download the Xdebug source code, unpack it and go to the folder with the source code.
Then run:
phpize
Now since you have Apple M1 you will need to run these depending on the architecture that PHP from XAMPP was compiled for:
arch -arm64 sudo pecl install xdebug
or if PHP was compiled for x86_64 architecture, then run this command:
arch -x86_64 sudo pecl install xdebug
Then edit your php.ini
file at /Applications/XAMPP/xamppfiles/etc/php.ini. Add the following lines to the bottom of the file:
[xdebug]
zend_extension=/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20210902/xdebug.so
xdebug.mode=debug
xdebug.start_with_request=yes
I hope that helped, please let me know if something is not clear or if more information is needed.
Thank you!