shell whoami doesn't equal php shell_exec whoami?

后端 未结 4 948
挽巷
挽巷 2021-01-07 10:37

In a shell I do simple whoami and I get geoff, which is good, since that\'s who I am.

In a php file I have shell_exec(\'whoami\'); and I get nobody.

This see

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-07 11:07

    1. add "2>&1" to your command
    2. specify the full path to shell_exec(nobody has no $PAHT, so it just don't know where imagemagic binary is stored.
    3. try to run the script as user on the console to see that is going wrong.

提交回复
热议问题