I have this weird problem. The
php command is not found in one specific sitiation.
I try to call the command in three different ways. Only one of them fails:
johnI create a simple script which calls
php --version. Then as user
rootI call that script like this:
sudo -u john ./script.sh
This way the
phpcommand is not found.
rootI invoke the command directly like this:
sudo -u john php --version
No problem here, the command does exist.
I call the script directly as user 'john':
It works fine too.
What is causing this?
The problem happens with other users too, not just
john, and it happens on this particular machine only.
The OS is CentOS 5.9.
EDIT: Also, other commands like
python don't present this problem. The
php command is the only one I found so far with the problem.