Asynchronous-PHP's Popen function problem

Source: Internet
Author: User
Tags fread
I use the Popen function to execute PHP code asynchronously

//a.php
  
   //b.php
  
   

Originally my code in b.php is to update the database (because the logic is too complex so there is no account to come up.), but the b.php code can be executed correctly only if the fread is executed in the a.php $open. If you remove the fread, you will not execute it. (No updates in the database)

Update: It seems to put the pclose away and normal execution. Seems to be the implementation of b.php code point of Time, if the early shutdown will affect the execution, is this the reason?

Reply content:

I use the Popen function to execute PHP code asynchronously

//a.php
  
   //b.php
  
   

Originally my code in b.php is to update the database (because the logic is too complex so there is no account to come up.), but the b.php code can be executed correctly only if the fread is executed in the a.php $open. If you remove the fread, you will not execute it. (No updates in the database)

Update: It seems to put the pclose away and normal execution. Seems to be the implementation of b.php code point of Time, if the early shutdown will affect the execution, is this the reason?

Try Pclose (Popen ("php b.php-a $argv 1-b $argv 2 &", ' R '));

  • Related Article

    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.