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! 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 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 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. 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 Link to comment https://forums.phpfreaks.com/topic/86430-automatic-scripts/#findComment-441791 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.