|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-09-10 23:27 UTC] 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.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 15:00:01 2025 UTC |
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)?