Cannot install Composer on my MacBook Air M2

I aleady install the xampp and it’s work
i print the “hello world” on the localhost and it’s work

But when install the composer
(
php -r “copy(‘https://getcomposer.org/installer’, ‘composer-setup.php’);”

The Result is (zsh: command not found: php) for all the lines

php -r “if (hash_file(‘sha384’, ‘composer-setup.php’) === ‘dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6’) { echo ‘Installer verified’; } else { echo ‘Installer corrupt’; unlink(‘composer-setup.php’); } echo PHP_EOL;”

The Result is (zsh: command not found: php) for all the lines

php composer-setup.php

The Result is (zsh: command not found: php) for all the lines

php -r “unlink(‘composer-setup.php’);”

The Result is (zsh: command not found: php) for all the lines

)

what the solution for this problem please, I try to install the homebrew but it was not installed also, i don’t know what the issue