Skip to content

Instantly share code, notes, and snippets.

@iRynoh
Last active April 17, 2019 17:01
Show Gist options
  • Save iRynoh/b54ceede254cb2bc9bdfc8570f362f04 to your computer and use it in GitHub Desktop.
Save iRynoh/b54ceede254cb2bc9bdfc8570f362f04 to your computer and use it in GitHub Desktop.
GET parameters php command script

Workaround in case of missing php-cgi binary

alias php-cgi="php -r '"'parse_str(implode("&", array_slice($argv, 2)), $_GET); include($argv[1]);'"' --"
php-cgi test1.php foo=123

If file:

echo 'You set foo to '. $_GET['foo']
cat test1.php

Will output:

You set foo to 123.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment