note 24430 rejected from function.exec by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Thu, 15 Aug 2002 22:32:45 +0000 |
| Subject: | note 24430 rejected from function.exec by jmcastagnetto | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-35107@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 ?