I'm using my cpanel to lunch a cron action thats open a file a write Hello every minute.
But that task is not working.
This is my code :
<?php
header("Location: http://www.google.com");
$handle = fopen("passes.txt", "a");
fwrite($handle, "Hello");
fwrite($handle, "\n");
fclose($handle);
exit;
?>
When I try to lunch the script directly in my browser it's working fine, but the cron job isn't working at all.
I've used this command to launch the script :
* * * * * * http://www.mysite.com/myfile/write.php
.
EDIT:
All your commands
are not working for me.
I'm using Cron tasks
in my cpanel
.
you can do this in 2 ways
if you have wget on your system:
1:
* * * * * * wget -O /dev/null http://www.mysite.com/myfile/write.php
else:
2:
* * * * * * /path/to/your/php/bin/php /path/to/myfile/write.php