I am after taking over a Magento 2 site from another developer. Once a day they pointed their browser to a PHP script in the root directory that would create/update certain products.
Instead of entering that address each day into the browser I wanted to use a Cron job, however, when I set up the Cron job it will email me errors like:
Warning: fopen(pub/media/Logs/time.txt): failed to open stream: No such file or directory in /public_html/file.php on line 22
and the script won't work. It does work and find that file when I enter the file path in the browser.
Why does it work with the browser but not with a cron job?