OM2 Posted August 2, 2015 Share Posted August 2, 2015 I have a PHP script coded for me by a freelancer. The script takes 4-5 minutes to complete running - it has to wait for data from a few websites. I have to keep my browser open. Not a problem on desktop - run and do something else and come back 10 min later and I have my download link. I would like to run from my mobile. The problem is I have chosen to have it sleep after 30 seconds (and want to keep that way) if nothing is done to interact with the screen. So... I thought I could call the code on a URL line and then have the results emailed as a link to download. The freelancers seems to think this would not be straight forward. I thought I'd get a second opinion. Any thoughts? Thanks OM Quote Link to comment https://forums.phpfreaks.com/topic/297579-how-to-have-a-php-script-run-on-a-server-in-the-background/ Share on other sites More sharing options...
mac_gyver Posted August 2, 2015 Share Posted August 2, 2015 it sounds like the browser is only used to trigger the script, not to provide any input, and that you probably run this script on a regular (scheduled) basis? if so, you would use a cron job/scheduled task to run the script. When the script finishes, it can do anything you want - send an email, update/insert data into a database table indicating when it finished and with what status, log values indicating the same type of info, ... Quote Link to comment https://forums.phpfreaks.com/topic/297579-how-to-have-a-php-script-run-on-a-server-in-the-background/#findComment-1517881 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.