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! 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. 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. 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 &"); ?> 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.. 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
Archived
This topic is now archived and is closed to further replies.