Question

I'm having some problems with the function pcntl_fork() in php.

I'm using XAMPP and I'm trying to use that function and keeps me showing this error:

Call to undefined function pcntl_fork()

I dig something on Google and in XAMPP forums but couldn't find anything totally useful. I found some forums saying that i need to enable some configuration called

--enable-pcntl

I saw the phpinfo() and i have that option in the configure command. Can you help me?

Thanks in adavnce,

Elkas

Was it helpful?

Solution

@Elkas, I don't know your XAMPP version, but XAMPP 1.8.0 on my computer is with pcntl extension. You can try command "/opt/lampp/bin/php -m | grep 'p' " to check the extension list of your php.

OTHER TIPS

It is configuration, but not runtime. It's compile time configuration. When compiling you have to do:

./configure --enable-pcntl
make
make install

If it's not compiled in you can't enable it without recompiling.

Note:

Currently, this module will not function on non-Unix platforms (Windows).

http://php.net/manual/en/pcntl.installation.php

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top