Getting error sh: -t: command not found from a PHP CLI script

I am trying to use mail in a PHP script from the CLI but get the error:
sh: -t: command not found

Related tags: PHP

Credit: Original Poster

Some sites suggested installing sendmail-devel which I did, but not sure if that fixed it.
What fixed it ended up being changing the initial script statement from:

#!/usr/bin/php


To:

#!/usr/bin/php --php-ini=/etc/php.ini

Rating: 1

Propose a different solution...