Posted by cmarvel on 09/22/05 04:29
All:
I have a script using php-cgi 4.3 module. The script attempts to use
the pcntl_fork() call but gets the error message "call to undefined
function: pcntl_fork()" instead. Anyone know what's going on?
I have Apache 2.0+, Php-cgi 4.3 Mandrake Linux 9.1.
Here is my fork.php script:
#!/usr/bin/php-cgi
<?php
$pid = pcntl_fork();
if ($pid == -1) {
die('could not fork');
} else if ($pid) {
// we are the parent
echo "I am the parent, pid = ". $pid ."\n";
pcntl_wait($status); //Protect against Zombie children
} else {
// we are the child
echo "I am the child, pid = ". $pid ."\n";
}
?>
[Back to original message]
|