I'm trying to run a very simple PHP script on cron on a third-party hosting server and I have encountered a weird problem. The script's contents is NOT executed although I got confirmed that the cron does execute the script in scheduled times. I cannot check the Cron settings as it is not on my server, yet I would like to know if there is something I do wrong?
The script is for testing purpose only and thus it is very simple:
<?php
$file = fopen("file-" . rand(1000, 9999) . '.txt', 'w');
fwrite($file, 'cron');
fclose($file);
?>
When I run this script manually, the file is created. When I leave it on Cron, nothing happens. What can be the cause? The permissions of the script are 777. Do I do something wrong or is the problem on a server?
Many thanks.