Shell_exec chmod on crontab not working?
I have a line in crontab and a php script like below:
/ etc / crontab: -
*/1 * * * * root /usr/bin/php /var/www/html/xxx.php
php: -
<?php
shell_exec("sudo chmod 655 /files/to/path/xxx.wac");
?>
When I run manually
sudo / usr / bin / php / var / www / html / xxx.php
It works as it should. However, when the crontab reaches one minute, it does not execute the command in php as it should.
Note. Checked on syslog, it runs this command every minutes.
+3
source to share
No one has answered this question yet
Check out similar questions: