#50503 [NEW]: proc_open loses constants with $env
| From: | tidustracker at freenet dot de | Date: | Thu, 17 Dec 2009 00:40:38 +0000 |
| Subject: | #50503 [NEW]: proc_open loses constants with $env | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-145830@lists.php.net to get a copy of this message | ||
From: tidustracker at freenet dot de
Operating system: Windows Vista
PHP version: 5.3.1
PHP Bug Type: Program Execution
Bug description: proc_open loses constants with $env
Description:
------------
It seems that passing an array(filled or empty) to proc_open drops the two
constants SOL_TCP and SOL_UDP in created process
Reproduce code:
---------------
$arrConstants = get_defined_constants(true);
print('Constants: '. count($arrConstants['sockets']) . PHP_EOL);
print_r($arrConstants['sockets']);
ob_start(); ?>
$arrConstants = get_defined_constants(true);
file_put_contents('D:/proc_open_bug.txt', 'Constants: '.
count($arrConstants['sockets']) . PHP_EOL .
print_r($arrConstants['sockets'], true));
<?php
$strCode = ob_get_contents();
ob_end_clean();
$arrDescriptor = array(0 => array('pipe', 'r'), 1 =>
array('pipe', 'w'),
2 => array('pipe', 'w'));
$arrOptions = array('suppress_errors' => false, 'bypass_shell' => true);
$arrPipes = array();
$strCWD = null;
$arrEnv = array('process' => true); // Constants SOL_TCP and SOL_UDP are
NOT available in opened process
#$arrEnv = null; // All fine with constants SOL_TCP and SOL_UDP
proc_open('php_53 -r "'. $strCode. '"', $arrDescriptor, $arrPipes,
$strCWD, $arrEnv, $arrOptions);
Expected result:
----------------
passing an array to proc_open expects 86 constants including SOL_TCP and
SOL_UDP in the new process
Actual result:
--------------
only 84 constants
--
Edit bug report at http://bugs.php.net/?id=50503&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50503&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50503&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50503&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=50503&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50503&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=50503&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=50503&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=50503&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=50503&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=50503&r=support
Expected behavior: http://bugs.php.net/fix.php?id=50503&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=50503&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=50503&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=50503&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50503&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50503&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=50503&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=50503&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=50503&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=50503&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=50503&r=mysqlcfg