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
The result from whoami
you obtained simply means that your apache is running as nobody
. This is as it should be and I strongly recommend not to change this.
The reason imagemagick doesn't work isn't probably directly related to the privileges with which your php code is run. There isn't enough information to diagnose the problem exactly, but it is most likely an executable or library search failure. Make sure that the binary and libraries are readable by nobody
and that they are in a location where apache will find them. In particular ensure that $PATH
and $LD_LIBRARY_PATH
are set up correctly.