sithik_frns Posted May 19, 2010 Share Posted May 19, 2010 Hi, I have a PHP application in which I get data from users and validate them. On successful validation I should initiate a process which may take time to complete. So I need to execute the process in the background. I tried exec and all. Unfortunately I can't bring what I need. Can someone here help me in this regard? Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/202244-how-to-run-background-process-in-php/ Share on other sites More sharing options...
ignace Posted May 19, 2010 Share Posted May 19, 2010 Split your script into smaller chunks and process it one at a time. Quote Link to comment https://forums.phpfreaks.com/topic/202244-how-to-run-background-process-in-php/#findComment-1060488 Share on other sites More sharing options...
sithik_frns Posted May 19, 2010 Author Share Posted May 19, 2010 Thanks for your reply buddy. I actually want to initiate a PHP script (Say 'Job A') in background on completion of a validation script (Say 'Validation'). Once Job A is initiated, Validation script will tell the visitor as 'Your request has been submitted' and this should not wait for Job A to complete its job. Since there should not be any delay I dont want to use Crons. Quote Link to comment https://forums.phpfreaks.com/topic/202244-how-to-run-background-process-in-php/#findComment-1060493 Share on other sites More sharing options...
JonnoTheDev Posted May 19, 2010 Share Posted May 19, 2010 To fork a process <?php exec("php /path/to/file.php > /dev/null &"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/202244-how-to-run-background-process-in-php/#findComment-1060494 Share on other sites More sharing options...
sithik_frns Posted May 19, 2010 Author Share Posted May 19, 2010 Let me try boss.. I will get back with the output.. Quote Link to comment https://forums.phpfreaks.com/topic/202244-how-to-run-background-process-in-php/#findComment-1060498 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.