Ignore_user_abort (1) and set_time_limit (0) then set an infinite loop. how do I terminate it?

Source: Internet
Author: User
Ignore_user_abort (1) and set_time_limit (0) then set an infinite loop. how do I terminate it? This post was last edited by zhoumengkang at 17:24:21


The example in ingore_user_abort () in the manual can be executed infinitely. But what if I terminate this process? The example in the manual is not described. If the server is not restarted. How can I find the process and terminate it?
ignore_user_abort(0); // run script in background set_time_limit(0); // run script forever $interval=2; // do every 15 minutes... do{ $data = '1
';file_put_contents('./test.html',$data,FILE_APPEND); sleep($interval); // wait 15 minutes }while(true);


Reply to discussion (solution)

In cli mode

   

Kill pid

Wrong, yes

 ignore_user_abort(1); 

In cli mode

    

After kill the pid, you can write it like you do. if I didn't write getmypid on it... I can only go to linux to find it?


In cli mode

     

After kill the pid, you can write it like you do. if I didn't write getmypid on it... I can only go to linux to find it?

It's hard to find a process without a pid, isn't it?

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.