executing php page using crontab
Posted: Fri Sep 20, 2002 7:12 am
Hi
I'm trying to execute a php page through a cron job, but nothing happens. Should I use:
or rather:
I'm not sure of the /usr/bin/lynx an /usr/bin/php paths (I get "the file/directory doesn't exist"). How will I know if these paths are correct?
Neither way seems to execute the php script through cron, although the php page executes fine when called from a webbrowser. Further the test.log file does get updated every minute, which means the cron job is working, but the test.log file remains empty and size 0 (it's suppose to display the echo's in the php page). I even tried to put the username of the test.php's owner in the statement but still no luck. Permissions on both test.php and test.log are 777 (for now).
Any ideas how to fix the problem?
Thanks in advance.
I'm trying to execute a php page through a cron job, but nothing happens. Should I use:
Code: Select all
* * * * * /usr/bin/lynx -dump http://www.mydomain.com/scripts/test.php >test.logCode: Select all
* * * * * /usr/bin/php -f /usr/local/.../scripts/test.php >test.logNeither way seems to execute the php script through cron, although the php page executes fine when called from a webbrowser. Further the test.log file does get updated every minute, which means the cron job is working, but the test.log file remains empty and size 0 (it's suppose to display the echo's in the php page). I even tried to put the username of the test.php's owner in the statement but still no luck. Permissions on both test.php and test.log are 777 (for now).
Any ideas how to fix the problem?
Thanks in advance.