From:             rograham at compuserve dot com
Operating system: Windows 2000
PHP version:      4.3.8
PHP Bug Type:     Variables related
Bug description:  $_SERVER[SystemRoot] is empty

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 bug report at http://bugs.php.net/?id=30059&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=30059&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30059&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30059&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=30059&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=30059&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=30059&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=30059&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=30059&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=30059&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=30059&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=30059&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=30059&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=30059&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=30059&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=30059&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=30059&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=30059&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=30059&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=30059&r=mysqlcfg

Reply via email to