I am trying to ultimately use php\'s shell_exec
function to create new Linux users. I am, however, running into problems even with the debugging. Here is my code
shell_exec()
As a general case, rather than having PHP execute several commands sequentially, I write a shell script that does everything I need, then call it from PHP. There's one fewer link in the chain when debugging, and I find I a lot easier.
With regards to your SSH command itself, since apache is executing as www-data
, how is it logging into the machine in question as root? Have you added the apache user's key to the remote machine.