I'm guessing that the parent process is sending a term signal to each child process. The nohup command will not be effective in this case as it only ignores the hangup signal; it may also not be effective if the invoking shell is not associated with a tty, but that's neither here nor there.
What might help would be to wrap your command in a shell subcommand that causes interrupt, term, hup and quit signals to be ignored. I've no experience with PHP, but from your example it might look something like this:
The idea behind this is that the PHP causes kshell (probably works in bash too) to be invoked to execute the command. The command given to the shell begins with a trap command that causes signals 1,2,3,4 and 15 to be ignored (the "") before executing the intended command.
I've assumed that the .= PHP operator is a += like operator and appends the string to the current value.
For a simple example, if my assumptions about PHP are wrong, consider the following that invokes the command t24 using this technique.
ksh -c '( trap "" 1 2 3 4 15; t24 )' &
I specifically invoke ksh as some systems invoke sh with a 'shell-exec' command and I don't know if plain Bourn shell supports this or not. If ksh is not in your path you will need to use the fully qualified pathname.
Adding an amper (&) before the closing paren should cause the process to become 'detached' from its process group and parent process (ppid should be 1) and unavailable to be signaled as a part of the process group (assuming that this is how/why the process is terminating as apache is bounced). The side effect of this is that the pid assigned to $pid will be incorrect; it will be that of the subcommand that invoked the process rather than the process itself.
Thank you for your efforts, it's getting killed , is there no way of keeping a process alive that was started from php ? The process dies on reload/stop/etc...