setproctitle

(PECL proctitle >= 0.1.0)

setproctitleSet the process title

说明

setproctitle ( string $title ) : void

Sets the process title of the current process.

参数

title

The title to use as the process title.

返回值

没有返回值。

范例

Example #1 setproctitle() example

Running the example below will change the process title (visible with ps a for example).

<?php
setproctitle
("myscript");
?>

以上例程的输出类似于:

$ ps a
  PID TTY      STAT   TIME COMMAND
 1168 pts/3    S      0:00 myscript                                                                                                                         

参见

  • cli_set_process_title() - Sets the process title
  • pcntl_fork() - 在当前进程当前位置产生分支(子进程)。译注:fork是创建了一个子进程,父进程和子进程 都从fork的位置开始向下继续执行,不同的是父进程执行过程中,得到的fork返回值为子进程 号,而子进程得到的是0。
  • setthreadtitle() - Set the thread title