Re: argc and argv doesn't work!

From: Date: Mon, 09 Sep 2002 18:13:14 +0000
Subject: Re: argc and argv doesn't work!
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-15727@lists.php.net to get a copy of this message
Use php-cli.exe. If you can't, check your php.ini file. argv and argc are usually turned off in the ini file. -- Scott Carr OpenOffice.org Documentation Maintainer http://documentation.openoffice.org/ Quoting Christian Pichler <Christian.Pichler@cpm-consulting.com>: > Hey there, > > We would like to use the variables argc and argv. The problem is that argc > always has the value 1, whether we pass no, one, two or more parameters. And > in the array argv there is only the name of the program. > > We are working on a computer with Windows 2000 and a local installation of > PHP on it. The global variable register_argc_argv is set to Local Value: ON > and Master Value: ON. We've tried it with PHP 4.0.6 and PHP 4.2.3. > > Here's the source and the output of the test program: > > program source (test1.php): > =========================== > > <?php > > echo "Commandline - Parameter\n\n"; > $x = $argc; > print("Result (value of argc): $x\n"); > > ?> > > > command line: > ============= > > case 1 (without parameters) - OK: > --------------------------------- > > C:\>test1.php > X-Powered-By: PHP/4.0.6 > Content-type: text/html > > Commandline - Parameter > > Result (value of argc): 1 > > > > case 2 (with 2 parameters) - NOT OK: > ------------------------------------ > > C:\>test1.php param1 param2 > X-Powered-By: PHP/4.0.6 > Content-type: text/html > > Commandline - Parameter > > Result (value of argc): 1 > > > Does anyone know why this doesn't work? Or what the problem is? > Thanks in advance! > > Michael and Christian > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/

« previous php.windows (#15727) next »