downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

setthreadtitle> <Fonctions Proctitle
[edit] Last updated: Fri, 24 May 2013

view this page in

setproctitle

(PECL proctitle >= 0.1.0)

setproctitleDéfinit le titre du processus

Description

void setproctitle ( string $title )

Définit le titre du processus courant.

Liste de paramètres

title

Le titre à utiliser comme titre du processus.

Valeurs de retour

Aucune valeur n'est retournée.

Exemples

Exemple #1 Exemple avec setproctitle()

L'exécution de l'exemple ci-dessous modifiera le titre du processus (visible avec la commande ps a par exemple).

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

L'exemple ci-dessus va afficher quelque chose de similaire à :

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

Voir aussi



add a note add a note User Contributed Notes setproctitle - [1 notes]
up
0
zodbd421 at gmail dot com
1 month ago
Note that this extension is considered buggy.  See https://wiki.php.net/rfc/cli_process_title, which says:

"...but it is incomplete and might lead to memory corruption on Linux (or any OS which does not support setproctitle.

The reason is the extension only has access to original argv[0] (that comes from main()). argv and environ(7) are in contiguous memory space on Linux. The extension presumes that argv[0] can accomodate 128 characters, but usually that is not possible because argv[0] is “php”. When this happens, the extension will scribble on argv[1], argv[2], etc., and maybe even environ and this can have destructive side effects on the running program."

 
show source | credits | stats | sitemap | contact | advertising | mirror sites