>I've recently had a need to write a standalone script that needs to fork off >a number of children during its operation, and I'd like to use PHP since >I've already written most of the functions in a web application I did in >PHP. But, I'm now not so sure if that's feasible.
It can certainly be done, any number of ways... >According to the docco, process control is supplied by the "pcntl" module >which isn't compiled into PHP by default (and doesn't appear to be compiled >into the 4.1.2 Red Hat RPMs that are on the machine). The documentation >also describes it as "experimental", although that could just be old >documentation... The docos are almost for sure correct. PHP's idea of "experimental" is roughly equivalent to Microsoft version 2.2 products, if that helps :-) >The program would be a production system... before I proceed trying to >recompile support in, could I get some feedback on just how reliable it is? >Should I be trying to do this in another language instead? If pcntl turns out to be unstable, or you just don't want to risk it, you could: 1. Use & in exec() which sometimes works depending on if the command you exec() binds stdout/stderr or not, which Apache/PHP are already using for the browser, so if it does, your & doesn't work. [At least, that's my working hypothesis...] 2. Have a shell "stub" that does the fork() for you, but do all the grungy work in PHP, which makes life easy. 3. Have the shell fork() off as many children you need to start with, or... Well many more variations on #2 are possible really. While you may lose a little bit of performance in the "fork" itself, that's probably not going to be a bottle-neck overall, unless you're just process-crazy or something... -- Like Music? http://l-i-e.com/artists.htm I'm looking for a PRO QUALITY two-input sound card supported by Linux (any major distro). Need to record live events (mixed already) to stereo CD-quality. Soundcard Recommendations? Software to handle the recording? Don't need fancy mixer stuff. Zero (0) post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo audio-to-disk. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php