Edit report at https://bugs.php.net/bug.php?id=37267&edit=1
ID: 37267
Comment by: martijntje at martijnotto dot nl
Reported by: php at dogtoe dot com
Summary: pcntl functions working under mod_php under some
distros (FreeBSD/Debian)
Status: Bogus
Type: Bug
Package: PCNTL related
Operating System: Linux zeus 2.6.15-gentoo-r1
PHP Version: 5.1.2
Block user comment: N
Private report: N
New Comment:
This would not be such a big issue, were it not for the fact that PHP does not
return the correct exit code when using proc_close. The manual clearly
indicates
one should use pcntl_wexitstatus to determine the exit code.
Because of this, it is not possible to get the exit status from a program
started
from apache's mod_php
Previous Comments:
------------------------------------------------------------------------
[2006-05-02 07:16:37] [email protected]
We neither recommend nor support using pcntl with PHP as web server module.
------------------------------------------------------------------------
[2006-05-01 23:11:30] php at dogtoe dot com
Can anyone confirm that the only way to obtain the functions in apache is to
generate a shared module for pcntl?
------------------------------------------------------------------------
[2006-05-01 22:13:11] php at dogtoe dot com
Description:
------------
I'm hearing contradicting results about pcntl functions working in apache. The
manual clearly states they were not meant for webserver environments, but does
not say they wont work for webserver environments. It also states that it WILL
work for CGI/CLI, but does not say it will NOT work for mod_php (apache module).
I'd like to bring attention to bug #'s 18536 and 32896, where users have said
that the pcntl extension is not available. Developers derick and sniper have
reported that this is not possible under apache (mod_php) but only in cgi/cli
mode.
Well, here's contradicting proof:
TML, an Op in #php on Freenode, has PCNTL working under a debian install, not
even self-compiled, as well as other private test-dev machines. Here is
phpinfo() from the debian install: http://joeysmith.com/info.php
Additionally, I have confirmed reports of it working under FreeBSD, where the
user simply used --enable-pcntl as part of the build command.
I checked with the Gentoo ebuild (package) maintainers and they all claim this
is a PHP problem as they are simply passing --enable-pcntl into the build
command.
Regardless of any personal bias against using pcntl functions under a
webserver, I'd like to know once and foreall if it is possible to somehow
enable these functions under mod_php in apache2 because they appear to not even
be defined.
Reproduce code:
---------------
$pid = pcntl_fork();
Expected result:
----------------
No errors.
PCNTL module to show up in phpinfo().
No more contradicting results.
Actual result:
--------------
$pid = pcntl_fork();
Returns:
Fatal error: Call to undefined function pcntl_fork() in
/var/www/localhost/htdocs/test/index.php on line 2
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=37267&edit=1