Question

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.

Was it helpful?

Solution

"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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top