Jump to content

Call to undefined function: pcntl_fork()


tomfmason

Recommended Posts

I think that I am most likely missing something in the php.ini. When I try a simple forking script I get the following error.  [b]Call to undefined function: pcntl_fork()[/b]

here is the forking script
[code]
<?php
$pid = pcntl_fork();
if ($pid == -1) {
    die("The fork did not work");
}elseif ($pid) {
    echo "This is the parent and the pid is <b>$pid</b><br />";
}else{
    echo "This is the child and the pid is <b>$pid</b>";
}
?>[/code]

I am testing this on a windows platform with php 5.0.2

Any suggestions would be great.

Thanks,
Tom
Link to comment
https://forums.phpfreaks.com/topic/18963-call-to-undefined-function-pcntl_fork/
Share on other sites

[quote=php.net]
Installation

Process Control support in PHP is not enabled by default. You have to compile the CGI or CLI version of PHP with --enable-pcntl configuration option when compiling PHP to enable Process Control support.

    Note: Currently, this module will not function on non-Unix platforms (Windows).

[/quote]
http://www.php.net/manual/en/ref.pcntl.php
lol.. I guess I should read the manual fully. Thanks.

Well I have a problem then. I am attempting to fork a socket script and I have no idea how. I looked at the phpfreaks forking tutorial and realized that it is not realy forking tutorial but rather a tutorial for back dooring a process.

Any suggestions?

Thanks again,
Tom

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.