Jump to content

Archived

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

tomfmason

Call to undefined function: pcntl_fork()

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Erm...
[code]<?php
if ($all_that_can_be_learnt == $is_learnt) {
    $life = "Boring";
}
?>[/code]
Bad grammar! :D

Share this post


Link to post
Share on other sites
Why do you need to fork, out of curiosity? There is practically no need to fork for any web application scenario.

Share this post


Link to post
Share on other sites
@Jenk
I have written a socket server that realy bogs the server. 

@Yessideez
I guess that I will stop asking questions here. Every time I do I am met with sarcasm.

Share this post


Link to post
Share on other sites

×

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.