Re: $argv and $argc registration
| From: | Zeev Suraski | Date: | Thu, 19 Jul 2001 08:42:24 +0000 |
| Subject: | Re: $argv and $argc registration | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-60265@lists.php.net to get a copy of this message | ||
ini_set() cannot be used to handle register_globals or register_argc_argv, because by the time this function gets called - it's already 'too late' for doing these tasks. You have to use a method of setting these directives before the script even begins to execute, via php.ini, httpd.conf or .htaccess.
Zeev
At 10:49 19/07/2001, J. Jones wrote:
I am not subscribed to this list, so please CC: or reply directly to me. Thanks! I may be doing something wrong.. I'm not real sure. Neither $argc or $argv seem to be registered with the cgi version of php 4.0.6 and up. The test script: <?php ini_set ('register_globals', 1); ini_set ('register_argc_argv', 1); var_dump ($argc); var_dump ($argv); ?> exits with the following: Warning: Undefined variable: argc in ./foo.php on line 5 NULL Warning: Undefined variable: argv in ./foo.php on line 6 NULL regardless of any command line options passed to it. Older scripts that work fine with php 4.0.5 fail with 4.0.6, with identical build options and php.ini settings. The above script also behaves as expected on php 4.0.5. Any ideas? Am I missing something? Does this work for other people? -- Jeremy -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net-- Zeev Suraski <zeev@zend.com> CTO & co-founder, Zend Technologies Ltd. http://www.zend.com/