Using php module from termux as root?
Use

tsu -e


The option -e preserves your environment, and should be enough to run your script without errors.

Also note that tsu is just like Linux su, which opens another shell instead of running a command.