Every 15 minutes, I need to run a PHP script. So I created a execute.sh file containing this line:

php execute.php >> twitter.log

When I run the script manually, it works. Oddly, running it from cron is not working. Here is the contents of crontab:

*/15 * * * * /var/www/TwitterBot-master/execute.sh >> /dev/null 2>&1

Obviously, the script has the right permissions.

Thanks for your help

  • What crontable are you using? root or user?
    – fcm
    Commented Jun 18, 2016 at 19:33

1 Answer 1


You should always use the full path when you don't know the execution environment.

Use the full path to the php executable.


/usr/bin/php /var/www/TwitterBot-master/execute.php >> /var/www/TwitterBot-master/twitter.log

Not the answer you're looking for? Browse other questions tagged or ask your own question.