LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   PHP behaving strangely with PCNTL functions (https://www.linuxquestions.org/questions/linux-software-2/php-behaving-strangely-with-pcntl-functions-674309/)

ratcateme 10-05-2008 12:36 AM

PHP behaving strangely with PCNTL functions
 
I have done alot of coding in php and i am trying to learn how to effectively use the PCNTL functions. i have this code
PHP Code:

<?php
$pid 
pcntl_fork();
print 
"start\n";
if (
$pid) {
    
// parent process runs what is here
    
pcntl_waitpid($pid$statusWUNTRACED);
    print 
"parent\n";

} else {
    
// child process runs what is here
    
print "child\n";
}
?>

i can run it from from terminal using "php pcntl.php" and it runs fine
when i go to http://localhost/pcntl.php it says
Code:

Fatal error: Call to undefined function pcntl_fork() in /var/www/html/asd.php on line 2
is it possible to get these functions to work or is Apache disabling them?

Scott.


All times are GMT -5. The time now is 02:25 PM.