Included in my thesis is to create an administration interface, in which an administrator can approve users whom have asked for access to use OpenNebula.
Upon approval the users should be added to OpenNebula (i.e. it corresponds
to the command
oneadmin createuser username password). (More information
of the interface (section 4.2).)
I am trying to perform this with an execution of a shell command in a PHP file. Why doesn't this work (below is just a specific example - not the general code that I am using)?
$execQuery = "/bin/su oneadmin postgres -c '/usr/bin/oneuser create test10 test10'"; shell_exec ($execQuery); //execute query in shell.
Nor does this work (even though I am logged in as oneadmin, when the script is executed by PHP):
shell_exec ("/usr/bin/oneuser create test10 test10");
It works when I type that command in the shell. I have tried to execute other shell commands through php and those work fine, so I wonder where the problem lies.
I have given the file
rwx rights for all users.