Bug #74986 [Opn]: Environment variables set via putenv are not accessible via parse_ini_*

From: Date: Tue, 25 Jul 2017 21:02:09 +0000
Subject: Bug #74986 [Opn]: Environment variables set via putenv are not accessible via parse_ini_*
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-210325@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74986&edit=1 ID: 74986 Updated by: ab@php.net Reported by: alan at aondra dot com Summary: Environment variables set via putenv are not accessible via parse_ini_* Status: Open Type: Bug Package: *General Issues Operating System: Windows 7 Professional SP1 x64 PHP Version: 7.1.7 Block user comment: N Private report: N New Comment: Thanks for the report. This feature is not documented, why is it expected behavior? Furthermore, it is not thread safe and therefore not portable. I'd tend to say it's a won't fix. Thanks. Previous Comments: ------------------------------------------------------------------------ [2017-07-25 16:29:38] alan at aondra dot com Actual results appear on a second Windows-based server running PHP 7.1.6 on Windows 7 Professional SP1 x64. Expected results appear on Amazon EC2 instance running Amazon Linux AMI release 2017.03 with PHP 7.0.16 and Apache HTTPD 2.4.25. ------------------------------------------------------------------------ [2017-07-25 11:04:25] alan at aondra dot com Description: ------------ --- From manual page: http://www.php.net/function.parse-ini-file --- In Windows environment, putenv does not make environment variables accessible to either of the functions parse_ini_string or parse_ini_file. Sample on test site 3v4l.org works as expected, but fails in local Windows development environment. Apache HTTPD 2.4.27 PHP 7.1.7 x64 TS Test script: --------------- <?php putenv('FOO=bar'); var_dump(getenv('FOO')); $str = <<<'EOF' BAZ=${FOO} EOF; $ini = parse_ini_string($str); var_dump($ini); Expected result: ---------------- string(3) "bar" array(1) { ["BAZ"]=> string(3) "bar" } Actual result: -------------- string(3) "bar" array(1) { ["BAZ"]=> string(0) "" } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74986&edit=1

« previous php.bugs (#210325) next »