linux - How to communicate pid from one PHP process to another?
There is a long-lived PHP process, which supports signals (
SIGHUP etc.) and another PHP process needs to know the PID of the first one to send a signal.
I'd like to set an environment variable, which would be read in the second (client) process and used for my purposes, but
putenv(...posix_getpid()...) doesn't seem to make it visible to another process.
How do I make an environment variable, set in one PHP process, visible to another? If that's impossible, what's the preferred way (I'd like not to use files or db for this)?