Quite important, I don't really know how to write PHP, but I have some experience with JavaScript.
I created a PHP file which scrapes a website and writes the data to different (22) JSON files. If I visit the file from my browser the script does what it supposed to do and it creates the 22 JSON files.
Nou I wanted to use the cronjob functionality to run the script daily. I tried it and I received a mail with the echo's I normally would see in my browser, so I could say the script runs. The script has to run to post the echo's. But there are no JSON-files created.
Why doesn't my script create the files when I run it via a cronjob?
I'm using this function to write the files:
function write_to_file($value,$content) {
echo "Done<br>";
$file = fopen($value.".json","w");
fwrite($file,$content);
fclose($file);
}