Is there a tool which given a cgi program, and the arguments (query string, method, file to upload, etc.) would set the correct environment variables, and execute this program (with or without a debugger.
Something like this perl script, only more solid, with a more clear output and input, support for files, etc.
Well, a new open source project was born from this question. I’m copying my answer from here.
If you just want to see your CGI running, you can use my tiny runCGI project.
All you need is to set a
yamlfile which looks something like thisand then run
You will see the output on the console’s standard output.
You can even debug it with
gdb, debug runCGIgdb runCGI, run with the correct parameters (run someyaml.yaml), issuetcatch exec(tcatchcatches it only once) and then set breakpoints to your CGI file: