php - Opening and writing to files in cron job -


i set cron job on site hostinger supposed scrape news contents , dump information text file. isn't want cron output be, byproduct of running script.

if wisit webpage located at, success. correctly opens file , writes news data it. when it's run cron job, however, output

php warning:  fopen(../txtdumps/newsdump.txt): failed open stream: no such file or directory in /home/u189772133/public_html/cronjobs/newsscrape.php on line 12 unable open file 

i've never done cron job before, bad practice open , write files within one, or pathing issue?

check have granted php file access write information hard drive.

also may make sure passed mode fopen

fopen("../txtdumps/newsdump.txt", "w") 

you can check permissions issue

how give php write access directory?


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -