Giving a PHP CLI process a process name -
for project working on, spawning multiple amount of worker processes. thing is, don't appear in apple's activity monitor, because don't have proper title set.
i tried use cli_set_process_title
function available since php 5.5. unfortunately, xdebug pins me console:
warning: cli_set_process_title(): cli_set_process_title had error: not initialized correctly in /users/ingwie/work/bird3/php-lib/yii_worker.php on line 22 call stack: 0.0012 264080 1. {main}() /users/ingwie/work/bird3/php-lib/request_handler.php:0 0.0286 1219016 2. workerman\worker::runall() /users/ingwie/work/bird3/php-lib2015-07-01t20:12:03.185z - info: bird3 worker@41603 online! /request_handler.php:103 0.0315 1252488 3. workerman\worker::forkworkers() /users/ingwie/work/bird3/php_modules/walkor/workerman/worker.php:328 0.0507 1254312 4. workerman\worker::forkoneworker() /users/ingwie/work/bird3/php_modules/walkor/workerman/worker.php:748 0.0561 1252896 5. workerman\hprose->run() /users/ingwie/work/bird3/php_modules/walkor/workerman/worker.php:779 0.0561 1253744 6. workerman\worker->run() /users/ingwie/work/bird3/php_modules_ext/hprose-workerman/hproseworkermanservice.php:142 0.0591 1316400 7. call_user_func() /users/ingwie/work/bird3/php_modules/walkor/workerman/worker.php:1286 0.0591 1316472 8. appserver::{closure:/users/ingwie/work/bird3/php-lib/request_handler.php:38-40}() /users/ingwie/work/bird3/php_modules/walkor/workerman/worker.php:1286 0.0592 1316920 9. appserver::emit() /users/ingwie/work/bird3/php-lib/request_handler.php:39 0.0592 1318152 10. call_user_func_array() /users/ingwie/work/bird3/php-lib/request_handler.php:76 0.0593 1318224 11. evenement\eventemitter->emit() /users/ingwie/work/bird3/php-lib/request_handler.php:76 0.0593 1318320 12. call_user_func_array() /users/ingwie/work/bird3/php_modules/evenement/evenement/src/evenement/eventemittertrait.php:64 0.0593 1318704 13. {closure:/users/ingwie/work/bird3/php-lib/yii_worker.php:21-25}() /users/ingwie/work/bird3/php_modules/evenement/evenement/src/evenement/eventemittertrait.php:64 0.0593 1318800 14. cli_set_process_title() /users/ingwie/work/bird3/php-lib/yii_worker.php:22
and proctitle
extension sets weird title. not appear on activity monitor, in ps
:
504 44278 44261 0 10:44pm ttys000 0:00.00 bird3: workerman worker local/etc/fish __fish_runtime_dir=/tmp/fish.ingwie __fish_help_dir=/usr/local/share/doc/fish __fish_datadir=/usr/local/share/fish __fish_bin_dir=/usr/local/bin
and isn't of environment variables.
as can see, there seems no way set process title.
or know one?
php: 5.5.20 os x: 10.10.3
php os supplied:
ingwie@ingwies-mbp ~/w/bird3 $ php-config --configure-options --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking --sysconfdir=/private/etc --with-apxs2=/usr/sbin/apxs --enable-cli --with-config-file-path=/etc --with-config-file-scan-dir=/library/server/web/config/php --with-libxml-dir=/usr --with-openssl=/usr --with-kerberos=/usr --with-zlib=/usr --enable-bcmath --with-bz2=/usr --enable-calendar --disable-cgi --with-curl=/usr --enable-dba --with-ndbm=/usr --enable-exif --enable-fpm --enable-ftp --with-png-dir=no --with-gd --with-jpeg-dir=/usr/local --enable-gd-native-ttf --with-icu-dir=/usr --with-ldap=/usr --with-ldap-sasl=/usr --with-libedit=/usr --enable-mbstring --enable-mbregex --with-mysql=mysqlnd --with-mysqli=mysqlnd --without-pear --with-pear=no --with-pdo-mysql=mysqlnd --with-mysql-sock=/var/mysql/mysql.sock --with-readline=/usr --enable-shmop --with-snmp=/usr --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-tidy --enable-wddx --with-xmlrpc --with-iconv-dir=/usr --with-xsl=/usr --enable-zend-multibyte --enable-zip --with-pcre-regex=/usr
it seems necessary superuser use functionnality on macos 10.10.x.
sorry not able getting working.
link advanced discussion problem : cannot set process title in php command line script using cli_set_process_title() os x?
Comments
Post a Comment