PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
topaz
Forum Newbie
Posts: 1 Joined: Thu Mar 15, 2007 10:45 am
Post
by topaz » Thu Mar 15, 2007 10:49 am
From the command prompt in windows, if I run ‘php.exe test.php arg1’ from the CLI I can retrieve arg1 using $argv[1] inside of test.php
However, if I run ‘php-cgi.exe test.php arg1’ I get the error ‘Undefined index: argv’
What is the proper way to retrieve args from inside your php code using php-cgi.exe?
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Thu Mar 15, 2007 11:01 am
Why do you use php-cgi .exe when you want the functionality of cli ?
stereofrog
Forum Contributor
Posts: 386 Joined: Mon Dec 04, 2006 6:10 am
Post
by stereofrog » Thu Mar 15, 2007 11:47 am
Have you tried $_SERVER['argv'] ?