etrader Posted April 14, 2011 Share Posted April 14, 2011 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). Quote Link to comment https://forums.phpfreaks.com/topic/233709-running-a-php-code/ Share on other sites More sharing options...
monkeytooth Posted April 14, 2011 Share Posted April 14, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/233709-running-a-php-code/#findComment-1201535 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.