Why does it works in Command Line but not in Crontab ?
Posted: Fri May 30, 2008 3:05 am
I wanna to run a PHP programe periodically, which require more than one hour.
I wrote a programe that will write log for each action it done. and it will write <end> tag whem it done
My program can be run properly in terminal when I triggered it manually using
And I wrote below on the Crontab,
but the just wrote a few line of log and stop logging without <end> tag
Why does my program can run properly in Command Line, but not in crontab ???
(I have used ini_set and require_once('Zend/Db.php'), is it the reason that program is not work in crontab ??)
I wrote a programe that will write log for each action it done. and it will write <end> tag whem it done
My program can be run properly in terminal when I triggered it manually using
Code: Select all
/opt/lampp/bin/php -d max_execution_time=3600 /opt/lampp/htdocs/proejct/a.php -d todayCode: Select all
0 * * * * /opt/lampp/bin/php -d max_execution_time=3600 /opt/lampp/htdocs/proejct/a.php -d todayWhy does my program can run properly in Command Line, but not in crontab ???
(I have used ini_set and require_once('Zend/Db.php'), is it the reason that program is not work in crontab ??)
Code: Select all
ini_set("include_path", ini_get('include_path'). PATH_SEPARATOR .dirname(__FILE__));
require_once 'Zend/Console/Getopt.php';