Jump to content

Running a php code


etrader

Recommended Posts

I want to run a php file which contains a long process and takes time. If I simply run the file on browsers, the process will be interrupted by any perturbation in the internet connection or closing the browser. How I can force the php process to continue running without connection to my local PC (server side controlling)? I am looking for something like what cron job does (but only one time, not periodically).

Link to comment
https://forums.phpfreaks.com/topic/233709-running-a-php-code/
Share on other sites

there really isn't a one time.. with anything automated.

 

You can however build a function that through the use of a cron will run or not run.. think of a light switch. you set the cron to a weekly event since you really only want it once per say. then in the script the cron would call to you you would in a crude concept wrap the over all task you want done in an if-else-then type of statement. If this variable == on, then run my function.. if its off just ignore it. If it ignores it then nothing happens if it doesnt it runs the function. either way it happens without the need of intervention from you and your browser, and actually may run quicker in the end game as it doesnt have to load up in a browser as well.

Link to comment
https://forums.phpfreaks.com/topic/233709-running-a-php-code/#findComment-1201535
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.