need to rename a php process from within itself? i came across the need to do so for jackmunch and this works for me.
check out this "bug" report http://bugs.php.net/bug.php?id=29479
last tested on centos 5.1 and php 5.3.0alpha3-dev
# wget http://nedren.com/proc-title/proc-title.tar
# tar -xf proc-title.tar
# cd proctitle
# /usr/bin/phpize
# ./configure
# make
# make install
- copy extension (proctitle.so) to your extension directory
- add the following to php.ini:
extension = proctitle.so
- function bool setproctitle( string $newtitle ) is now available
<?php
function setProcessTitle($new_title) {
$clear_title = str_pad('cleartitle', 65, ' ', STR_PAD_RIGHT);
setproctitle($clear_title);
setproctitle($new_title);
}
?>