Create file with CRON job

Hello,
I have a problem when creating file with cron job via cpanel.
In the same file there is a query to a database (INSERT), so surely each hour runs cron.
But the file is not created.
However, if you access the script through a browser, a file is created
Here is part of the script to create a file:

$myfile = fopen("/home/mysite/public_html/mycron.txt", 'w');
$txt = "test1\n";
fwrite($myfile, $txt);
fclose($myfile);

Code (markup):
And here is cron

Minute    Hour    Day    Month...
Code (markup):
Create file with CRON job

from PHP http://ift.tt/20uKQRr
via IFTTT
Previous
Next Post »
Thanks for your comment