码迷,mamicode.com
首页 > Web开发 > 详细

php查看进程

时间:2020-04-23 22:49:02      阅读:112      评论:0      收藏:0      [点我收藏+]

标签:osi   created   父进程id   dem   div   php   dex   macbook   user   

 

 index.php

<?php
/**
 * Created by PhpStorm.
 * User: mac
 * Date: 2020/4/23
 * Time: 21:57
 */

echo posix_getpid();
while(true)
{
	sleep(1);
}

php index.php

mac@macdeMacBook-Pro:/www/learn_lumen/wang$     php index.php 
47976

 

查看进程号ID

mac@macdeMacBook-Pro:/www/learn_lumen/wang$     ps -ef|grep index.php
  501 47976 89607   0 10:01下午 ttys000    0:00.07 php index.php
  501 47986 90454   0 10:02下午 ttys002    0:00.00 grep index.php
mac@macdeMacBook-Pro:/www/learn_lumen/wang$ 

 查看父进程ID

<?php
/**
 * Created by PhpStorm.
 * User: mac
 * Date: 2020/4/23
 * Time: 21:57
 */

echo posix_getpid().PHP_EOL;
echo posix_getppid();
while(true)
{
	sleep(1);
}

 

mac@macdeMacBook-Pro:/www/learn_lumen/wang$     php index.php 
48015
89607

 

mac@macdeMacBook-Pro:/www/learn_lumen/wang$     ps -ef|grep index.php
  501 48015 89607   0 10:03下午 ttys000    0:00.08 php index.php
  501 48018 90454   0 10:03下午 ttys002    0:00.00 grep index.php
mac@macdeMacBook-Pro:/www/learn_lumen/wang$ 

 

php查看进程

标签:osi   created   父进程id   dem   div   php   dex   macbook   user   

原文地址:https://www.cnblogs.com/php-linux/p/12763993.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!