$GLOBALS["argv"] and $argv empty, $_SERVER["argv"] just fine
<p>I am fighting with a (perhaps) simple problem with PHP CLI running on Hostgator shared hosting. A simple code:</p>

<pre><code>&lt;?php
var_dump($argv);
var_dump($GLOBALS["argv"]);
var_dump($_SERVER["argv"]);
var_dump(ini_get("register_argv_argv"));
?&gt;
</code></pre>

<p>When run on my local machine as well as several other instances of php as:</p>

<pre><code>php test.php arg1
</code></pre>

<p>Outputs correctly as predicted:</p>

<pre><code>array (
  0 =&gt; 'test.php',
  1 =&gt; 'arg1'
)
array (
  0 =&gt; 'test.php',
  1 =&gt; 'arg1'
)
array (
  0 =&gt; 'test.php',
  1 =&gt; 'arg1'
)
1
</code></pre>

<p>But run from cron on Hostgator shared hosting it outputs:</p>

<pre><code>array (
)
NULL
array (
  0 =&gt; 'test.php',
  1 =&gt; 'arg1'
)
1
</code></pre>

<p>The code I am fighting with is a legacy one and that relies heavily upon $GLOBALS["argv"] to parse command line parameters. I have no means to modify the whole codebase to rely on $_SERVER["argv"] instead.</p>

<p>What might be the reason why all my instances of PHP fills all the arrays with commandline parameters, and the hosted php on Hostgator does not populate $GLOBALS["argv"] at all?</p>

<p>I made a workaround to deal with this problem, but I hate when I don't know why something is happening :)</p>

<p>Thanks for any ideas!</p>
