Running a process in the background
Posted: Tue Feb 06, 2007 2:40 pm
I'm new to PHP and web dev in general, and I found a lot of posts that sorta talk about this, but I figured I'd ask anyway as I've seen quite a few different ideas on doing this.
I have a page that lists a bunch of records, the user can select some of these records and submit them as a 'job'. When these records are submitted, I call an external program (currently using the exec function) to process these records and make an output file. This program can take awhile to run.
What I want to do is, when the job is submitted, go to a page that starts the program in the background from an include file, and then redirects the user to a jobs page where it will display and monitor jobs. The part that is giving me problems is starting the external program and getting it to run in the background, and after that being able to check its status.
Any help or ideas would be greatly appreciated, thanks. If there is a better way to do something like this, let me know, too!
I have a page that lists a bunch of records, the user can select some of these records and submit them as a 'job'. When these records are submitted, I call an external program (currently using the exec function) to process these records and make an output file. This program can take awhile to run.
What I want to do is, when the job is submitted, go to a page that starts the program in the background from an include file, and then redirects the user to a jobs page where it will display and monitor jobs. The part that is giving me problems is starting the external program and getting it to run in the background, and after that being able to check its status.
Any help or ideas would be greatly appreciated, thanks. If there is a better way to do something like this, let me know, too!