PHP CLI: Sending parameters via command line



Hi all,

How do a run a .php file via shell script (CLI ) but providing
parameters?

For example to run foo.php in unix I run the command:

php foo.php

But how do I pass parameters like in web interface: foo.php?
param1=value&param2=value2 via command Line?

The command:

php foo.php?arg1=value&arg2=value2

Will not work and the help just explain how to pass arguments that I
understand that is not parameters like in web - I can not modify
foo.php to make it get arguments, only standard web parameters
(retrieved via $_GET ).

Thanks

Erico
.



Relevant Pages

  • PHP-CLI and the "less" command (kubuntu)
    ... I have a CLI application that produces lots of output to the terminal, so I like to send the output along to the "less" command. ... But I've now tried in different terminal programs, and reading output other than output from PHP, and the ONLY time it happens is when I pipe output from PHP to "less". ... It may work well the first time, but when repeating the same command a second time, the "weird" behavior starts. ... It could very well be some kind of problem with "less", but since I can only reproduce the problem with output from PHP CLI, I thought it's worth asking here. ...
    (php.general)
  • Re: IIS 6.0 on Windows Server 2003
    ... If PHP insists on using CMD.EXE to execute the shellcommand on the ... server, then no, you have no choice -- you must give read permissions to the ... this would be a security vulnerability caused by PHP. ...
    (microsoft.public.inetserver.misc)
  • Re: [PHP] PHP-CLI and the "less" command (kubuntu)
    ... I have a CLI application that produces lots of output to the terminal, so I like to send the output along to the "less" command. ... But I've now tried in different terminal programs, and reading output other than output from PHP, and the ONLY time it happens is when I pipe output from PHP to "less". ... It could very well be some kind of problem with "less", but since I can only reproduce the problem with output from PHP CLI, I thought it's worth asking here. ... The keystrokes are processed by less so your problem lies there or more likely with the terminal emulation you're using. ...
    (php.general)
  • Re: regarding system function
    ... > In Php If I send a command to system function ... > then It will return 1 on success and 0 on failure. ... I want the result like php system ... On unix, that's the 1/0 you ...
    (comp.lang.python)
  • Re: Wnidows Server 2003 - I need help in getting the Connection Co
    ... command if already running. ... it fires off the netstat command for you, sending the results from that to ... another file which your PHP process can access. ... requires administator access we are get file permison problems - ANY IDEAS ...
    (microsoft.public.windowsmedia.server)