|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-11-11 12:52 UTC] danielc at analysisandsolutions dot com
Description:
------------
$_SERVER['argv'] and $_SERVER['argc'] aren't created.
php.ini and phpinfo() show register_argc_argv as being On.
Behavior is the same via CLI or CGI binaries.
Substituted a known good php.ini file to see ensure the file was getting parsed. Same results.
Everything worked fine under 500b2-dev--php5-win32-200310010230
Problem began when upgraded to 500b2-dev--php5-win32-200311040330
Persists in the current CVS snapshot
500b3-dev--php5-win32-200311111530
Reproduce code:
---------------
#! c:/progra~1/php/cli/php
<?php
print_r($_SERVER['argv']);
?>
now execute test script...
./t.php fjiao
Expected result:
----------------
Array
(
[0] => ./t.php
[1] => fjiao
)
Actual result:
--------------
Notice: Undefined index: argv in d:\t.php on line 3
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 02:00:01 2025 UTC |
Greg just posted on the internals list that he too noticed that $_SERVER['argv'] and $_SERVER['argc'] aren't set. He also made a very interesting observation that $argv and $argc ARE set. EXAMPLE SCRIPT argvtest.php: <?php var_dump($argv); var_dump($_SERVER['argv']); ?> INVOCATION: C:\PROGRA~1\php>php argvtest.php 1 2 OUTPUT: array(3) { [0]=> string(12) "argvtest.php" [1]=> string(1) "1" [2]=> string(1) "2" } Notice: Undefined index: argv in C:\PROGRA~1\php\argvtest.php on line 3 NULL