I'm working on buidling a control panel when I stumbled across running PHP on the command line as a daemon vs interactively mode. I'm not sure of the difference or why one would prefer over another.
I would assume running a script as a daemon requries PCNTL to be compiled to control child processes and stop any new children processes to spawn until the last completes. For example, analyzing stats may take quite some time, so better to spawn a child that handles it, but careful not to spawn another until the child is finish.
Of course, you could execute the command in PHP to send it to the background which would be a process own it's own, but need to rescan the processes running to make sure it doesn't flood the servers with processes, eventually killing the server.
Which would be better? Running a script as a daemon using PCNTL or as nohup script.php & in interactive mode, sending it to the background.
The issue I have is that later I want to scale this to a Windows platform, manage command line operations on a Windows box, but PCNTL was made for LINUX, so how would go about handling processes in Windows?