开发者

PHP - proc_open - How does env forwarding work?

PHP's documentation for the proc_open function states that when spawning a child process, you can pass null as the value for the 'env' parameter to forward the parent script's environment down to the child process. Has anyone here done this, and if so, would you mind elaborating on this?

If a user has开发者_如何转开发 session data in the parent process, is that passed to the child? if the parent process has included various libraries, classes, etc..., are those also passed down to the child?

Thank you.


"Environment" means just the set of environment variables, such as PATH. The proc_open function starts a new process and executes a new command, and no data is shared between the calling process and the new one (but the two processes can communicate through pipes).

See the Wikipedia page for "environment variable" for a general explanation of what environment variables are: http://en.wikipedia.org/wiki/Environment_variable.

PHP documentation on environment variables: http://php.net/manual/en/reserved.variables.environment.php.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜