About killing the PHP process in Linux

Source: Internet
Author: User
Tags php tutorial pkill
1. How do I kill all the PHP processes in Linux?

[Wz@supportserver-51 jd]$ Ps-ef | grep pure-ftpd | Grep-v grep | awk ' {print $ ' "$ $} ' | Xargs kill-9 = pkill php
Kill:can ' t find process ' = '
Kill:can ' t find process "Pkill"
[2] killed PHP dingdan_money.php >> jd.csv
[3] killed PHP dingdan_money.php >> jd.csv
[4] killed PHP dingdan_money.php.bak >> jd.csv
[5] killed PHP dingdan_money.php >> jd.csv
[6] Killed PHP test1.php (wd:/USR/LOCAL/WEBDATA/YEWU/YEWU)
(WD now:/USR/LOCAL/WEBDATA/JOB/JD)
[7] killed PHP test1.php >> 1.txt (wd:/USR/LOCAL/WEBDATA/YEWU/YEWU)
(WD now:/USR/LOCAL/WEBDATA/JOB/JD)
[8] killed PHP dingdan_money.php >> jd.csv
[9] killed PHP dingdan_money.php >> jd.log
[Killed] php dingdan_money.php >> jd.log
[One] killed PHP dingdan_money.php >> jd.log 2>&1
[Killed] php dingdan_money.php >> jd.log
[Killed] php dingdan_money.php > Jd.log
[Killed] php-q dingdan_money.php >> jd.log
[Killed] php-f dingdan_money.php >> jd.log
[Killed] php-q dingdan_money.php >> jd.log
[17]-killed PHP dingdan_money.php >> jd.log
[Wz@supportserver-51 jd]$ ps-ef|grep PHP
Root 6561 6549 0 19:29 pts/0 00:00:00 php dingdan_money.php
Root 7901 6690 0 19:36 pts/0 00:00:00 sudo php dingdan_money.php
Root 7902 7901 0 19:36 pts/0 00:00:00 php dingdan_money.php
WZ 12713 6690 0 20:10 pts/0 00:00:00 grep php
[18]+ killed PHP dingdan_money.php >> jd.log

2. Workarounds for PHP scripts that always hang when they are run:

[wz@supportserver-51 jd]$ php dingdan_money.php >> jd.log &
[2] 13340
[Wz@supportserver-51 jd]$ LL
Total 3760
-RWXRWXRWX 1 tuangouadmin Ops 1524 Dec 20:04 dingdan_money.php
-RWXRWXRWX 1 tuangouadmin Ops 3845934 Dec 20:14 jd.log
[2]+ Stopped php dingdan_money.php >> jd.log

[wz@supportserver-51 jd]$ php dingdan_money.php >> jd.log</dev/null&

can use </dev/null to solve, the specific reason is unknown.

The above describes the killing of Linux in the PHP process, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.