#37989 [Bgs->Opn]: Enviroment variables not availabe on exec,mail,...

From: Date: Mon, 03 Jul 2006 05:57:53 +0000
Subject: #37989 [Bgs->Opn]: Enviroment variables not availabe on exec,mail,...
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-99053@lists.php.net to get a copy of this message
ID: 37989 User updated by: david at ols dot es Reported By: david at ols dot es -Status: Bogus +Status: Open Bug Type: Apache related Operating System: Linux PHP Version: 4.4.2 New Comment: If PHP can access that variables via getenv() it (should) mean that they are in the enviroment and should also be accesible to programs called by PHP, but they are not. This does not look like a apache issue, it's PHP who calls the external programs and who has the chance to set it's enviroment Previous Comments: ------------------------------------------------------------------------ [2006-07-02 20:36:26] tony2001@php.net This is how Apache works and apparently PHP cannot change it. Not PHP problem. ------------------------------------------------------------------------ [2006-07-02 18:29:04] david at ols dot es varibles set by putenv() are correctly set and visible inside programs called by exec(), passthrough(), ... in the other hand also env vars set by SetEnv apache directive are also not available inside programs called via exec(), passthrough(), ... ------------------------------------------------------------------------ [2006-07-02 18:28:16] david at ols dot es varibles set by putenv() are correctly set and visible inside programs called by exec(), passthrough(), ... in the other hand also env vars set by SetEnv apache directive are also not available inside programs called via exec(), passthrough(), ... ------------------------------------------------------------------------ [2006-07-02 17:13:10] david at ols dot es Description: ------------ Apache Environment variables (DOCUMENT_ROOT, SERVER_NAME, etc ...) are visible via phpinfo() and getenv() but not inside programs called via exec() and also not available to the mailer when called via mail() Reproduce code: --------------- test.php: <?php passthrough('print_env'); ?> print_env: #!/bin/sh /usr/bin/printenv Expected result: ---------------- the very same variables reported as "Apache Enviroment" when calling phpinfo() Actual result: -------------- just a few standard shell variables ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37989&edit=1

« previous php.bugs (#99053) next »