Hi Nick, PHP's execution commands like exec will execute the program as the user your web server is running as (generally someone like nobody or www), in order to get it to execute as someone else the program needs to be setuid.
Running programs as Root setuid is generally considered dangerous and should only be done when absolutely necessary. If you create a root setuid program that your web-server can run anyone with the ability to place scripts on your server can execute this program. There has been a lot of discussion about this on this list before, if you search the archives you will find more information. Additionally try searching google for setuid. Jason On Mon, 2003-02-03 at 20:52, Nick Kordas -: Wildthing Communications wrote: > Anyone know how to use shell_exec or exec and execute a shell script as user > root ? > > --------------------------------------------- > Regards > Nick > Wildthing Communications > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ~~~ > How can a species, that can create machines to communicate, fail to > communicate amongst themselves ? > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ~~~ > This email and any files transmitted with it may be legally privileged and > confidential. If you > are not the intended recipient of this email, you must not disclose or use > the information contained > in it. If you have received this email in error, please notify us by return > email and permanently > delete the document. > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ~~~ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php