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
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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.