note 24430 added to function.exec
| From: | william at websynergy dot ca | Date: | Thu, 15 Aug 2002 21:05:22 +0000 |
| Subject: | note 24430 added to function.exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-35090@lists.php.net to get a copy of this message | ||
I am curious if anyone has successfully been able to run a /sbin/shutdown r now command via php
I have created a simple php containing:
<?
exec("/u/www/reboot");
?>
and reboot consist of:
#!/bin/sh
/usr/bin/sudo /sbin/shutdown -r now
I just keep getting the password prompt in the apache error log by the way I am running this on a
fresh RH 7.3 setup I have also tried removing the /usr/bin/sudo from the reboot shell script but the
error log then shows me you must be root to do that! , how can I get php to execute this kind
of script ?
--
http://www.php.net/manual/en/function.exec.php
http://master.php.net/manage/user-notes.php?action=edit+24430
http://master.php.net/manage/user-notes.php?action=delete+24430
http://master.php.net/manage/user-notes.php?action=reject+24430