I have a question.
Currently i am using this shell_exec(), to run a script, and getting results.
The problem is that the script runs in a loop displaying results, every second, while this function only gives me the first part of the result.
I am assumming that the function exit and does not wait to loop through until the script is finished.
The script i am running, loops forever, until the user manually terminates the script.
I want to be able to run the scrip, and get all results, every second and display them on my web page (run.php).
this is what i am using at the moment.
$output = shell_exec('cd testrig; ./processXML.php LoopSimTest.xml');
echo $output;
I am using linux.
Thank you in advanced.
shell_exec not displaying all
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: shell_exec not displaying all
Not the way to use PHP. You script is essentially a daemon. Have it write the output to some sort of buffer and have PHP poll.
(#10850)