Recommended for phppclose () functions

Source: Internet
Author: User
1. how does PHPpopen implement concurrent execution of multiple processes? the pclose in the loop will wait until the process is completed and then perform the next loop. 2. suppose there are 17 processes to be enabled, how to start 5 processes each time, and shut down a process every time a process is completed, and start the next process at the same time, that is to say, only five processes can start two processes at the same time for ($ i0; $ I & lt; 2; $ I ++) {$ command & quot; $ phpPath $ destPHPFile & gt; $ logF... 1.PHP popen how to implement multi-process concurrent execution, the pclose in the loop will wait for the process to complete and then carry out the next loop 2. suppose there are 17 processes to be enabled, how to start 5 processes each time, and shut down a process every time a process is completed, and start the next process at the same time, that is to say, only five processes can run at the same time // start two processes for ($ I = 0; $ I <2; $ I ++) {$ command = "$ phpPath $ destPHPFile> $ logFile $ I"; echo "process start time ". date ('Y-m-d H: I: s '). "\ n"; $ resource = popen ($ command, 'r'); if (is_resource ($ resource) {$ success ++; pclose ($ resource ); // the next loop will wait until the execution of the previous process is completed, and pclose will release the resource

1. how does popen implement concurrent execution of multiple processes? the pclose in the loop will wait until the process is completed and then perform the next loop.

Introduction: 1.PHP popen implements concurrent multi-process execution. the pclose in the loop will wait until the process is completed and then perform the next loop. 2. suppose there are 17 processes to be enabled, how to start 5 processes each time, and shut down a process every time a process is completed, and start the next process at most...

2. PHPmailer group-sending Gmail FAQ

Introduction: 1. cocould not authenticate first, if you do not use a loop, it is basically an incorrect account or password. if you use a loop to send a group, remember to call Smtpclose () after the send () method ends (), send once, otherwise only one email will be sent, and the second crash...

3. after popen in php is executed, it will wait until the script is executed. how can this problem be solved?

Introduction: After I use pclose (popen () in PHP, I will continue to execute it until the script running by popen is complete. {Code...} in test. php, the code runs until index. php is executed. why?

[Related Q & A recommendations ]:

How does php-popen implement concurrent execution of multiple processes? the pclose in the loop will wait until the process is completed and then perform the next loop.

How does popen implement multi-process concurrent execution? the pclose in the loop will wait for the process to complete and then perform the next loop.

In php, popen is executed only after the script is executed. how can this problem be solved?

The above is a detailed recommendation for the php pclose () function. For more information, see other related articles in the first PHP community!

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.