Question: Say we usually it access via

```
http://localhost/index.php?a=1&b=2&c=3

```

How do we execute the same on a Linux command prompt?

```
php -e index.php

```

But what about passing the $\_GET variables? Maybe something like `php -e index.php --a 1 --b 2 --c 3`? I doubt that'll work.

Answer: 
At the command line, paste the following:

```
export QUERY_STRING="param1=abc&param2=xyz" ;  
POST_STRING="name=John&lastname=Doe" ; php -e -r 
'parse_str($_SERVER["QUERY_STRING"], $_GET); parse_str($_SERVER["POST_STRING"], 
$_POST);  include "index.php";'

```
Use:

`php -r 'parse_str($argv[2],$_GET);include $argv[1];' index.php 'a=1&b=2'`

You could make the first part as an alias:

`alias php-get='php -r '\''parse_str($argv[2],$_GET);include $argv[1];'\'`

Then simply use:

`php-get some_script.php 'a=1&b=2&c=3'`