try:
composer -vvv about
check the top line to see which version of PHP composer is using.
I myself have to use something along the lines of
PATH=/path/to/php/8.3/bin:$PATH
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
PATH=/path/to/php/8.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
then run
source ~/.bash_profile
on login - I'm sure a more logical and better way exists but works for me applies - anyway try composer -vvv about
and see if it points you in the right direction