Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 243
  • Last Modified:

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?
0
jmfreema
Asked:
jmfreema
  • 3
  • 2
1 Solution
 
VGRCommented:
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)
0
 
VGRCommented:
in the IFRAME, the people can follow the progression of the update running completely independently from their surfing of the site.

I synchronize both processes via the DB
0
 
jmfreemaAuthor Commented:
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.

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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now