Jump to content

How to have a PHP script run on a server in the background


Recommended Posts

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

 

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, ...

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.