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 Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.