Link to home
Start Free TrialLog in
Avatar of jmfreema
jmfreema

asked on

PHP program execution/termination

Here's what I'd like to do... someone please tell me if its possible and how I might accomplish it:

I've got an external executable written in C and compiled. What it does is not important but it has the potential to run for a VERY long time.

I would like to make PHP execute this program but for a maximum of about 30 seconds so as not to delay the loading of the page significantly. If possible, to actually display an animated
"Thinking..."
gif before the program is executed (not sure how I would accomplish this).

Basically, I'd like php to execute the program, gathering its output in an array, but then kill the process if its taking too long so the page can finish loading and the visitors arent made to wait too long.

Possible?
Avatar of VGR
VGR

make it differently.
Use a hidden frame that "launches and surveys" the external program
During this time, the visitors have a fully functional site for themselves 8-)

I even use an IFRAME for this, on a site that hsa exactky the same problem (user access during a loooong update via the Net)
ASKER CERTIFIED SOLUTION
Avatar of VGR
VGR

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jmfreema

ASKER

Thanks anyway VGR: that answers a question, just not the one I asked ;)

I'm closing this just in the interest of cleanliness, but I still have to figure out how to do this. I think I might have to re-write the C code to terminate if too much time has passed.

:( Is there any way to change a grade once its given? I meant for that to be a 'B'