php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #49586 argv variables reverse registration
Submitted: 2009-09-18 09:47 UTC Modified: 2010-11-24 14:34 UTC
Votes:6
Avg. Score:4.2 ± 0.7
Reproduced:5 of 5 (100.0%)
Same Version:4 (80.0%)
Same OS:5 (100.0%)
From: michael dot schmidt at innogames dot de Assigned:
Status: Wont fix Package: *General Issues
PHP Version: 5.3.0 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: michael dot schmidt at innogames dot de
New email:
PHP Version: OS:

 

 [2009-09-18 09:47 UTC] michael dot schmidt at innogames dot de
Description:
------------
Sometimes i write php-cli Daemons who forks many different kind of childs. There is no way to identify this processes (e.g. by using ps or top ...)
If i change the argv varriable in my php-script, the argv varriables of the php-interpreter are untouched.

A solution would be a function which re-syncs the $argv from the php-script to the interpreter. This would change /proc/<pid>/cmdline and ps / top would display the given string.

Reproduce code:
---------------
<?php

$argv[1] = "BAR"; // Override argv

resyncargv(); // Requested function

?>


Expected result:
----------------
linux:~# ps ax
4030 ?        S      0:04 /usr/bin/php foo.php


Actual result:
--------------
linux:~# ps ax
4030 ?        S      0:04 /usr/bin/php BAR


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-22 04:54 UTC] just at another dot joe
Even better would be to make it so that $argv[1]="foo"; simply auto-updated, without the need to call a function, but I'd be quite happy with any update.
 [2010-11-24 14:34 UTC] jani@php.net
-Summary: argv Varriables reverse registration +Summary: argv variables reverse registration -Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 [2010-11-24 14:34 UTC] jani@php.net
http://www.steve.org.uk/Reference/Unix/faq_2.html#SEC22

Something like pcntl_exec() might work.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 07:01:27 2024 UTC