Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 FastCGI 应用程序,它在启动期间加载和处理大量数据。我希望它获得一些环境变量来确定它的输入数据路径,但据我所知,环境指针 envp 是随请求一起提供的。
我想在第一个请求之前执行 getenv,直接在 FCGX_Init() 之后说。可能吗?
是的,事实证明,与 -initial-env 对应的 lighttpd 是 lighttpd.conf 的 fastcgi.server 部分中的“bin-environment”数组。getenv() 从执行一开始就可以访问那里定义的值。