PHP - proc_open - 环境转发如何工作?

发布于 2024-12-03 15:28:01 字数 178 浏览 2 评论 0原文

PHP 的 proc_open 函数文档指出,在生成子进程时,您可以传递 null 作为“env”参数的值,以将父脚本的环境转发给子进程。这里有人做过这个吗?如果有的话,您介意详细说明一下吗?

如果用户在父进程中有会话数据,是否会传递给子进程?如果父进程包含各种库、类等...,这些也会传递给子进程吗?

谢谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情徒 2024-12-10 15:28:01

“环境”仅指环境变量集,例如PATHproc_open 函数启动一个新进程并执行新命令,并且调用进程和新进程之间不共享任何数据(但两个进程可以通过管道进行通信)。

有关环境变量的一般说明,请参阅 Wikipedia 页面的“环境变量”:http://en。 wikipedia.org/wiki/Environment_variable

关于环境变量的 PHP 文档: http://php.net/manual/en/reserved .variables.environment.php

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文