Ads Posted April 6, 2010 Share Posted April 6, 2010 I am trying to run a cron job every 5 minutes. 5 * * * * php5 -f/home/sites/skyytemple/public_html/cron_fivemins.php The cron emails me saying "Could not open input file: /home/sites/skyytemple/public_html/cron_fivemins.php" Im unsure what to do to fix this, as the file is there i can run it manually through entering the URL (I havent secured as i am worrying mroe on trying to get it to work) Quote Link to comment https://forums.phpfreaks.com/topic/197814-cron-jobs/ Share on other sites More sharing options...
DavidAM Posted April 7, 2010 Share Posted April 7, 2010 Are you sure that is the real and absolute path to the file? You say you can run it from a url; so add a line to echo the file path (echo __FILE__ and see what it really is. Then use that path in the cron job (take that echo statement out of course). If that is the correct filepath, it may be a permissions issue. I'm not sure how your host works. I would guess that the file is owned by you (the login you use to upload files), and cron is running the job as you; and you have read access to the file. So it should work. On a side note, do you really want a cron job accessible as a url? That would mean that anyone with an internet connection can request the file and cause it to be executed. I would think you want the file in a private area so it is only run by your cron job. Quote Link to comment https://forums.phpfreaks.com/topic/197814-cron-jobs/#findComment-1038077 Share on other sites More sharing options...
Ads Posted April 7, 2010 Author Share Posted April 7, 2010 Haha Wow as if i over looked that. That worked thanks heaps =) How would you propose i make it more secure? Quote Link to comment https://forums.phpfreaks.com/topic/197814-cron-jobs/#findComment-1038098 Share on other sites More sharing options...
vero216 Posted May 28, 2010 Share Posted May 28, 2010 0/5 * * * * php5 -f/home/sites/skyytemple/public_html/cron_fivemins.php is the right one. UPDATE. Sorry but i think you may have another problem.Did you install php as an apache module?try this How to about cron and php Quote Link to comment https://forums.phpfreaks.com/topic/197814-cron-jobs/#findComment-1064660 Share on other sites More sharing options...
asep_dadang Posted July 10, 2010 Share Posted July 10, 2010 you can change the path to unaccessible from url for more secure cronjob. Quote Link to comment https://forums.phpfreaks.com/topic/197814-cron-jobs/#findComment-1084011 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.