Bug #50503 [Asn->Opn]: proc_open loses constants with $env
| From: | kalle@php.net | Date: | Tue, 24 Oct 2017 07:30:29 +0000 |
| Subject: | Bug #50503 [Asn->Opn]: proc_open loses constants with $env | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-212083@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=50503&edit=1
ID: 50503
Updated by: kalle@php.net
Reported by: tidustracker at freenet dot de
Summary: proc_open loses constants with $env
-Status: Assigned
+Status: Open
Type: Bug
Package: Program Execution
Operating System: win32 only - Windows Vista
PHP Version: 5.3.1
-Assigned To: pajoye
+Assigned To:
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2011-08-18 06:50:54] augf87 at gmail dot com
I´m having the same problem. Same conditions and same results. I´m using PHP 5.3.5, os Windows
XP 32bit.
------------------------------------------------------------------------
[2009-12-28 14:55:38] pajoye@php.net
Will take a look early in January for 5.3.2
------------------------------------------------------------------------
[2009-12-19 13:23:52] carsten_sttgt at gmx dot de
> but that's not a proc_open bug then.
Correct, but I think it there a basic problem with proc_open on Windows. In this case with the
environment.
Just see this example:
http://de.php.net/manual/en/function.proc-open.php#function.proc-open.examples
It's not working on Windows (returning 1 and no output). If you change:
- $process = proc_open('php', $descriptorspec, $pipes, $cwd, $env);
+ $process = proc_open('php', $descriptorspec, $pipes);
it's "working". But also no output, because the environment $_ENV is empty (even the
new process should inherit the current ENV).
if you now change:
- write($pipes[0], '<?php print_r($_ENV); ?>');
+ write($pipes[0], '<?php print_r($_SERVER); ?>');
you can see there is an output. But as long $env is an array (and not null) the script is not
working). And so it's also not possible to define new env variables for the new process.
Regards,
Carsten
------------------------------------------------------------------------
[2009-12-17 01:31:51] pajoye@php.net
but that's not a proc_open bug then. PHP has no idea about what has called it. I'm not
sure either why they are not defined in this case.
------------------------------------------------------------------------
[2009-12-17 01:22:23] tidustracker at freenet dot de
The script is working very well? Adjust the two paths and run it in CLI. The ENVs are not the
problem, the ENVs cause the problem.
The php example code starts via proc_open a new php process.
With an passed $env array to proc_open, the two constants SOL_TCP and SOL_UDP described at http://php.net/manual/en/sockets.constants.php
are missing in the new php process.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=50503
--
Edit this bug report at https://bugs.php.net/bug.php?id=50503&edit=1