Bash commands not executed when through cron job - PHP

Posted by basicxman on Stack Overflow See other posts from Stack Overflow or by basicxman
Published on 2010-05-01T01:43:42Z Indexed on 2010/05/01 1:47 UTC
Read the original article Hit count: 330

Filed under:
|
|
|
|

Hi there! I have a cron job running a PHP script every five minutes; the PHP script executes two bash commands at the end of the script. I know the script is running due to a log file it appends to. When I run the PHP script manually via the Ubuntu Gnome Terminal both bash commands execute flawlessly; however when the PHP script is triggered via cron, the two bash commands are not ran. Any ideas?

$command = 'notify-send "' . count($infoleakPosts) . '  New Posts."';
`$command`;

$command = 'firefox http://example.com';
`$command`;

*/1 * * * * php /home/andrew/grab.php USERNAME PASSWORD # JOB_ID_1

© Stack Overflow or respective owner

Related posts about php

Related posts about ubuntu