In my application, I am running a shell script but till the script completes executing the screen is blank. I am not able to display anything on screen. I want to display the log file to the user so till the log file is generated, i want the user to see some text content on the screen.
I read previous questions posted where they say multithreading in php is not possible.
Is there a way i can do this?
These two questions might be of some help:
1> exec(sprintf("%s > %s 2>&1 & echo $! >> %s", $cmd, $outputfile, $pidfile));
I would use jQuery.
Call the page loading the php script from the main page.
Link to jQuery.get() : http://api.jquery.com/jQuery.get/
These questions suggest it is and isn't possible, depending on whose answer your looking at; Multithreading in PHP
How can one use multi threading in PHP applications
You should take a look at; http://joseph.randomnetworks.com/2005/10/21/fake-fork-in-php/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.