Yes but it's VERY limited and no package manager at all. Normal bash scripts won't work, you have to change the shebang /system/bin/sh. Termux is a terminal emulator for Android 5.0+ and it has an apt package manager. It has an extensive package repository but idk if you can compile php with it.