running php script from cron with permissions

From: Date: Sun, 21 Jul 2002 17:09:08 +0000
Subject: running php script from cron with permissions
Groups: php.dev 
Request: Send a blank email to php-dev+get-86051@lists.php.net to get a copy of this message
Hi there, I've got a problem that's just a tidbit annoying. I've got a neat little php script to keep my home network running. At one point in this script it's required to reboot the machine the script is running on, and this I'm trying to do with exec("reboot"). Now, I run the cron job as root, and if I try "php <? exec("reboot"); ?> from console it works fine. But not when cron tries to. I've got my suspicions as to cron doing something kinky with the permissions, and therefore permissions are not enought for php to execute the reboot command. I've been at this all day, suggestions are more than welcome. Regards, /Hamlet

« previous php.dev (#86051) next »