Unable to run php / composer etc in relation ot a XAMPP installation through MacOs Terminal
Hello, I have recently purchase a new mac running monterey and commenced setting up my local installation of XAMPP for Mac (running php 8.1.6). Followed the instructions per the website and XAMPP has been installed successfully. The local server and all that works. The issue / concern resides when trying to run either php and or composer update commands via terminal. If i try to run any php command and or composer update command eg. php composer update or php test.php i receive the following error -
zsh: command not found: php
I am finding this very strange since i have installed php via the XAMPP package. Additionally, should i go directly to the htdocs folder and run the same file "test.php" it works fine. Or if i update composer dependencies within the development IDE in this case PhpStorm it all works fine.
I double checked my previous install on my pc as well as my old mac and it all works fine. Has something changed with Monterey and if so is there anyone who can assist to get Terminal to recongise php commands etc?
Please note the error still occurs when i try to run the same script command with sudo prefix.
Many thanks