jk11uk Posted January 17, 2008 Share Posted January 17, 2008 Hi i am wanting to make a script that is executed maybe several times a day, or even continuously (not sure how these things should work - server strain etc). How do i get my server to run a php script automatically? or at set times in the day? thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/86430-automatic-scripts/ Share on other sites More sharing options...
adam291086 Posted January 17, 2008 Share Posted January 17, 2008 You will need to set up a cron job. I have never tried one so can't help there. I know cron jobs are used to run php scripts periodically throughout the day. Google it and go form there Quote Link to comment https://forums.phpfreaks.com/topic/86430-automatic-scripts/#findComment-441689 Share on other sites More sharing options...
jk11uk Posted January 17, 2008 Author Share Posted January 17, 2008 thanks a lot mate Quote Link to comment https://forums.phpfreaks.com/topic/86430-automatic-scripts/#findComment-441772 Share on other sites More sharing options...
mbeals Posted January 17, 2008 Share Posted January 17, 2008 i actually do this. Make sure you have php-cli installed. I know it's in the apt repos if you're on debian....not sure about redhat. Then on your cron line just use: php -q /full/path/to/php/file.php as the command. You may also have to specify the full path to php. Quote Link to comment https://forums.phpfreaks.com/topic/86430-automatic-scripts/#findComment-441780 Share on other sites More sharing options...
jk11uk Posted January 17, 2008 Author Share Posted January 17, 2008 there is a good tutorial at: http://www.webmasters-central.com/t/cron.shtml Quote Link to comment https://forums.phpfreaks.com/topic/86430-automatic-scripts/#findComment-441791 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.