Home » PEAR » PEAR » Bug #9237
argv not in $_SERVER
Details
| Submitted | 2006-11-05 11:51 UTC |
|---|---|
| From | bug at 11 dot 2006 dot pear dot php dot net dot flonet dot net |
| Status | Wont fix |
| Package | PEAR |
| PHP Version | 4.3.1 |
| OS | linux |
| Roadmaps | (Not assigned) |
Comments
[2006-11-05 11:51 UTC] bug at 11 dot 2006 dot pear dot php dot net dot flonet dot net
Description:
------------
register_argc_argv=On is set in /etc/php.ini
Test script:
---------------
<?php
echo "argc = {$_SERVER['argc']}\n";
foreach ($_SERVER['argv'] as $k => $v) {
echo "_SERVER['argv'][$k] = $v\n";
}
?>
save as test.php
xyz@host ~# /usr/bin/php -C -q -d include_path=/usr/share/php -d output_buffering=1 -d open_basedir= -d safe_mode=0 -d register_argc_argv=On -d auto_prepend_file= -d auto_append_file= test.php a b c
fix:
remove -d register_argc_argv=On from cmdline
Expected result:
----------------
argc = 4
_SERVER['argv'][0] = test.php
_SERVER['argv'][1] = a
_SERVER['argv'][2] = b
_SERVER['argv'][3] = c
(from
xyz@host ~# /usr/bin/php -C -q -d include_path=/usr/share/php test.php a b c
)
Actual result:
--------------
pear:
ERROR: either use the CLI php executable, or set register_argc_argv=On in php.ini
test.php:
<br />
<b>Warning</b>: Invalid argument supplied for foreach() in <b>/root/test.php</b> on line <b>3</b><br />