top | item 16571228

(no title)

aaronholbrook | 8 years ago

Ah, no worries.

I'm not sure if you're thinking it would be web server dependent, but NGINX is the bigger share of the market. (Ideally it wouldn't matter what the web server is though).

discuss

order

danenania|8 years ago

Good to know - as you can see, I don't have a lot of PHP experience.

If anyone knows of a good way to get a PHP process's parent server pid (regardless of what server it's running on), please let me know :)

CaveTech|8 years ago

PHP has an execution model that's /really/ bad for per-process requests. Even attempting to grab the parent pid is probably not sufficient as you can have execution contexts with no parent (ex: running php from cron).

On linux you can get the master process through posix-getppid (http://php.net/manual/en/function.posix-getppid.php) but this won't work on windows and has the same limitations as above.

Have you thought about having a linux daemon/agent that runs in the background and keeps the ENV in sync?