473,246 Members | 1,410 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,246 software developers and data experts.

Call to undefined function: pcntl_fork() in php-cgi 4.3

All:
I have a script using php-cgi 4.3 module. The script attempts to use
the pcntl_fork() call but gets the error message "call to undefined
function: pcntl_fork()" instead. Anyone know what's going on?
I have Apache 2.0+, Php-cgi 4.3 Mandrake Linux 9.1.
Here is my fork.php script:

#!/usr/bin/php-cgi

<?php

$pid = pcntl_fork();

if ($pid == -1) {
die('could not fork');
} else if ($pid) {
// we are the parent
echo "I am the parent, pid = ". $pid ."\n";
pcntl_wait($status); //Protect against Zombie children
} else {
// we are the child
echo "I am the child, pid = ". $pid ."\n";
}

?>

Sep 22 '05 #1
3 10126
cm*****@nethere.com wrote:
I have a script using php-cgi 4.3 module. The script attempts to
use
the pcntl_fork() call but gets the error message "call to undefined
function: pcntl_fork()" instead. Anyone know what's going on?
I have Apache 2.0+, Php-cgi 4.3 Mandrake Linux 9.1.
Here is my fork.php script:


[snip]

The pctnl_* functions are not compiled in by default. You'll probably
need to compile it yourself to have access to these functions.

Also note the following from http://www.php.net/manual/en/ref.pcntl.php

"Process Control should not be enabled within a webserver environment
and unexpected results may happen if any Process Control functions are
used within a webserver environment."

--
Chris Hope | www.electrictoolbox.com | www.linuxcdmall.com
Sep 22 '05 #2
All:
I have compiled and installed the pctnl extension code as stated in
SELF-CONTAINED-EXTENSIONS. The pcntl_fork call still still comes up
with undefined function error. Anyone have any ideas?

Keith

Sep 22 '05 #3
On 22 Sep 2005 06:23:44 -0700, cm*****@nethere.com wrote:
All:
I have compiled and installed the pctnl extension code as stated in
SELF-CONTAINED-EXTENSIONS. The pcntl_fork call still still comes up
with undefined function error. Anyone have any ideas?

Keith


All:
I found out what the problem was. I had to fiddle with the extensions directory that php.ini looks at for extra
extensions. Thanks all!

Keith

Sep 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Krista | last post by:
Hi, I wrote a php project 2 years ago. I am totally lost right now. what is differnt between $userName, $_GET and $_REQUEST? In my past project, I remember i can use $userName as a variable, but i...
4
by: CoralineSage | last post by:
Hi All, I'm running a bulleting board in PHP and everytime a new user registers s/he is supposed to receive an email confirmation. After filling out the registration form and clicking on submit...
2
by: yawnmoth | last post by:
php.net's docs on pcntl_fork aren't exactly clear on how to spawn multiple child processes... i tried something like this, but it didn't seem to work: <? $pid1 = pcntl_fork(); $pid2 =...
4
by: xcomm | last post by:
I tried to create some images with php and gd and get always Call to undefined function imagejpeg() or Call to undefined function imagepng() PHP was build with --with-gd --with-zlib but I...
4
by: gc | last post by:
I'm a PHP and MySQL newbie. I have a feeling a lot of you may have seen this before. I'm teaching myself PHP/MySQL and trying to setup a guestbook. I'm running latest versions of Apache, PHP and...
1
by: annie | last post by:
Can anyone point me in the right direction here? I've got this little image script <?php $im = ImageCreate(200,200); $white = ImageColorAllocate($im,oxFF,oxFF,oxFF); $black =...
1
by: franscescomoi | last post by:
Hi. On PHP 4.3.10 on Linux I try to: ------ $im = imagecreate(400, 30); $black = imagecolorallocate($im, 0, 0, 0); imagettftext($image, 20, -3, 10, 20, $black, 'Arial.ttf', 'Test'); ------- ...
1
by: Lisa Pearlson | last post by:
Hi, I wish to write a little server script. It receives binary data and sends it back. Communication goes back and forth, so using apache is not possible. My little script will be a shell...
1
by: drewmania001 | last post by:
i've read various info on the web including the following http://php.mirrors.ilisys.com.au/manual/en/ref.mysqli.php mySQL Version 4.1.16 PHP Version 5.1.2 with Zend Engine v2.1.0 OS Windows...
9
by: java | last post by:
Hey there, I just removed an elderly PHP4-Installation from my Windows-Box and installed PHP 5.2.1. I used the PHP4-Module as local batchfile- interpreter by E:\ersDHCP>php ./extractLog.php ...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.