#16915 [Opn->Bgs]: Problems with super globals variables

From: Date: Thu, 22 Aug 2002 16:55:51 +0000
Subject: #16915 [Opn->Bgs]: Problems with super globals variables
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-17576@lists.php.net to get a copy of this message
ID: 16915 Updated by: iliaa@php.net Reported By: Jakub.Gnat@webdynamix.de -Status: Open +Status: Bogus Bug Type: Servlet related Operating System: SuSe Linux 7.3 PHP Version: 4.2.0 New Comment: Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. If you still experience the problem. Change $_SERVER to $HTTP_SERVER_VARS, $ENV to $HTTP_ENV_VARS and so on and see if those are empty as well. Previous Comments: ------------------------------------------------------------------------ [2002-04-30 05:28:34] Jakub.Gnat@webdynamix.de I tried once again the globals and $_GET $_POST work. Sorry for the confusion. I change a $_SERVLET to $_SERVER :-), but again at this time $_SERVER array is empty. $GLOBALS works. I don't have any idea how can I check a Runtime.exec() call and the semantic of this call. Can you help me with this. Kind regards ------------------------------------------------------------------------ [2002-04-29 18:47:38] preston.bannister@cox.net This doesn't look like a PHP bug. First, you used _SERVLET were you meant to say _SERVER in your example. An understandable mistake for someone who spends a lot of time with Java servlets :). Second, the _GET and _POST arrays were empty for the simple (and correct) reason that you did not have any GET or POST parameters to your request. Third, the _ENV array is empty simply because Java didn't pass any environment values - or at least that would be my suspicion. Check your Runtime.exec() call and the semantics of this call. ------------------------------------------------------------------------ [2002-04-29 14:53:50] Jakub.Gnat@webdynamix.de It seems to be that all super arrays are empty: This script: <?php echo "Globals test: <br>"; if (is_array($_SERVER)) { $size = sizeof($_SERVLET); echo "_SERVER is array $size <br>"; foreach ($_SERVER as $key => $value) { echo "Key: $key value: $value <br>"; } } if (is_array($_GET)) { $size = sizeof($_GET); echo "_GET is array $size <br>"; foreach ($_GET as $key => $value) { echo "Key: $key value: $value <br>"; } } if (is_array($_POST)) { $size = sizeof($_POST); echo "_POST is array $size <br>"; foreach ($_POST as $key => $value) { echo "Key: $key value: $value <br>"; } } if (is_array($_ENV)) { $size = sizeof($_ENV); echo "_ENV is array $size <br>"; foreach ($_ENV as $key => $value) { echo "Key: $key value: $value <br>"; } } echo "PHP_SELF $PHP_SELF <br>"; flush(); ?> as result: Globals test: _SERVER is array 0 _GET is array 0 _POST is array 0 _ENV is array 0 PHP_SELF /examples/php-servlet/test/global.php The arrays are empty. My environment: OS=Linux 2.4.10-4GB on i386 Tomcat 3.2.3 I use only Tomcat as web server without apache. Java version=1.3.1_03 Java vendor=Sun Microsystems Inc. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=16915&edit=1

« previous php.bugs (#17576) next »