ID: 30059 User updated by: rograham at compuserve dot com Reported By: rograham at compuserve dot com -Status: Bogus +Status: Open Bug Type: Variables related Operating System: Windows 2000 PHP Version: 4.3.8 New Comment:
I realize that the Summary and Comment History do not accurately summarize this documentation bug, but they do provide context for it.... The current PHP manual states in LXXXVIII. PHP Options&Information for getenv() "Note: This function does not work in ISAPI mode" For my 4.3.8 system running php4isapi.dll the call to getenv('SystemRoot') returns the expected path value (D:\WINNT)for SystemRoot (same as shown in the phpinfo() results). For this capability, I am grateful and simply request that the getenv() functionality be documented as supported for ISAPI. I realize that this may require checking all of the parameters in order to update the documentation more precisely. If the functionality was removed for PHP5, then the upgrade documentation should indicate that fact (that the code complies with the documentation as of V5). If you elect to disable getenv() for ISAPI, then could you please suggest how an ISAPI script is supposed to acquire that environmental information if the ENV array is no longer populated (per your recommended php.ini)? Previous Comments: ------------------------------------------------------------------------ [2004-09-11 15:21:54] [EMAIL PROTECTED] Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php ------------------------------------------------------------------------ [2004-09-11 00:22:18] rograham at compuserve dot com OK. It is making more sense now since I have been using the php.ini-recommended version which has: register_globals = off variables_order = "GPCS" So (as the comments clearly say), in order to access environment variables, you can (MUST) use getenv() instead. The $HTTP_ENV_VARS and $_ENV arrays remain empty. ------------------------------------------------------------------------ [2004-09-10 23:27:04] rograham at compuserve dot com Description: ------------ phpinfo() indicates correct SystemRoot value for Environment (in my case D:\WINNT) but $_SERVER[SystemRoot] and $_ENV[SystemRoot] both return empty. vardump of $GLOBALS shows: ["HTTP_SERVER_VARS"]=> array(34) {...} ["_SERVER"]=> array(34) {...} ["HTTP_ENV_VARS"]=>array(0) {} ["_ENV"]=> array(0) {} This may be "working as designed", but it appears that the whole issue of global variables registration has altered things. See below post for SugarCRM which uses JPGraph which relied upon [SystemRoot] values. VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Using PHP 4.3.8 and IIS 5.0 (isapi) and JPGraph 1.1.6 (or JPGraph 1.1.5) Problem in jpgraph.php for the path definition of the Font directory (and Cache as well) for Windows systems. JPGraph presumes that $_SERVER[SystemRoot] is a valid PHP predefined variable (it isn't). JPGraph 1.1.5 similarly used $_ENV[SystemRoot]. While trying to solve this problem, I upgraded to JPGraph 1.1.6 because I could see from other posts that there were some problems caused by PHP variable registration policies. THIS MAY JUST BE TRUE FOR ISAPI but the current PHP manual does not list "SystemRoot" as a valid $_SYSTEM variable. A key aspect of $_ENV variables is that they are diversely popluated by different environments, so this might have worked in the past for prior versions. It is odd, because phpinfo() does list the "SystemRoot" value (correctly). Each jpgraph.php script actually dies because the $_SYSTEM[SystemRoot]value is empty. You don't see the die message...which was obsolete anyways. Of course you don't see the graph either. Easy solution (so far) is to update jpg-config.inc in the jpgraph/src subdirectory to explicitly: DEFINE("TTF_DIR","yoursystemroot/FONTS/"); Mine is now: DEFINE("TTF_DIR","D:/WINNT/FONTS/"); The defective code is bypassed if the path is predefined this way. Now I get the pretty graphs in SugarSales!! Will contact JPGraph to update/correct their code/guidance. Will also post to PHP for documentation. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30059&edit=1