Re: Superuser for PHP Script

From: Date: Wed, 13 Mar 2002 13:45:56 +0000
Subject: Re: Superuser for PHP Script
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-88338@lists.php.net to get a copy of this message
If you want to use sudo you can do it with the fowling function: function loginsu(){ $fhandle = @popen("$sudo_path -u root clear", "w"); $fputs( $fhanlde, "$supassword"); @pclose($fhandle); } Dont forget to edit /etc/sudoers adding the folowing line apache ALL=PASSWD:ALL Do it at your own risk ----- Original Message ----- From: "Johannes Tyra [BrainData]" <info@braindata.de> To: <php-general@lists.php.net> Sent: Wednesday, March 13, 2002 3:06 PM Subject: [PHP] Superuser for PHP Script > Hi, > > I need superuser rights for a PHP Script, called by the Apache Webserver. > > Is it possible to do this with <? exec ("su")?? ?> What is with the root > password?? > Is there an other better way to do this? > > How can I print the current user/group under php is running? > > Thanx, > -- > Mit freundlichem Gruß, > Johannes Tyra > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#88338) next »