I am trying to take advantage of forking in php, a kind of multi-threading.
However, I keep getting an error.....Fatal error: Call to undefined function pcntl_fork(). Yet I have re-compiled the latest version of php 5.2.9 with --enable-pcntl.
Any ideas what else I am missing?
Fatal error: Call to undefined function pcntl_fork()
Moderator: General Moderators
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Fatal error: Call to undefined function pcntl_fork()
Are you running your script from command-line?
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Fatal error: Call to undefined function pcntl_fork()
Fixed it! Yes that was my problem. Thanks away.
How come it only runs from the command line?
How come it only runs from the command line?
Re: Fatal error: Call to undefined function pcntl_fork()
Straight from the docs:jaoudestudios wrote:How come it only runs from the command line?
Pcntl docs wrote:Process Control should not be enabled within a web server environment and unexpected results may happen if any Process Control functions are used within a web server environment.