Is there a way to get output content in real time using the exec CEO script of the shell_exec-PHP?

Source: Internet
Author: User
For example, it takes three minutes for exec to execute A script, and php returns the result and output content of A script three minutes later. Within three minutes of exec execution, each output line can obtain the output in real time. Is there any better way to do this? For example, it takes three minutes for exec to execute A script, php returns the result and output content of script A three minutes later. In the three minutes that I need to execute exec, each output line can get the output in real time. Is there any better way to do this?

Reply content:

For example, it takes three minutes for exec to execute A script, and php returns the result and output content of A script three minutes later. In the three minutes that I need to execute exec, each output line can get the output in real time. Is there any better way to do this?

Modify the issue of the blogger. No one else understands your intention. execute another script by calling the exec () function in php. Suppose you want to display exec () in the current script () the content of the script being executed in real time. The function itself does not seem to be allowed. Please refer to my ideas and wonder if it is the result you want.


  Called. out | tail-F ');

popen()

You cannot answer questions if you have enough words. Check the manual.

I think what you need issystemFunction

Both the execution shells are suspended for PHP. Add &

ob_flush();flush();

These two functions can help you. For more information, see the PHP manual.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.