I am attempting to run a command as root from a php page, is there any way to run shell_exec("su - root -c 'apt-get update'") (for example) and pass the password to the shell? Or is there another way to run a root command from php and pass the password to the command.
I would prefer not to do the follow:
edit the /etc/sudoers file;
install the ssh2 php extension;