tomfmason Posted August 29, 2006 Share Posted August 29, 2006 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 More sharing options...
shoz Posted August 29, 2006 Share Posted August 29, 2006 [quote=php.net]InstallationProcess 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 https://forums.phpfreaks.com/topic/18963-call-to-undefined-function-pcntl_fork/#findComment-81969 Share on other sites More sharing options...
tomfmason Posted August 29, 2006 Author Share Posted August 29, 2006 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 https://forums.phpfreaks.com/topic/18963-call-to-undefined-function-pcntl_fork/#findComment-81971 Share on other sites More sharing options...
Yesideez Posted August 29, 2006 Share Posted August 29, 2006 Erm...[code]<?phpif ($all_that_can_be_learnt == $is_learnt) { $life = "Boring";}?>[/code]Bad grammar! :D Link to comment https://forums.phpfreaks.com/topic/18963-call-to-undefined-function-pcntl_fork/#findComment-82047 Share on other sites More sharing options...
Jenk Posted August 29, 2006 Share Posted August 29, 2006 Why do you need to fork, out of curiosity? There is practically no need to fork for any web application scenario. Link to comment https://forums.phpfreaks.com/topic/18963-call-to-undefined-function-pcntl_fork/#findComment-82111 Share on other sites More sharing options...
tomfmason Posted August 29, 2006 Author Share Posted August 29, 2006 @JenkI have written a socket server that realy bogs the server. @YessideezI guess that I will stop asking questions here. Every time I do I am met with sarcasm. Link to comment https://forums.phpfreaks.com/topic/18963-call-to-undefined-function-pcntl_fork/#findComment-82129 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.