works. CGI (Common Gateway Protocol) is the classic standard way for web servers to send request information to programs, which then return some HTTP header lines, a blank, and the resulting data to send back to the client. The web server gives request information to the CGI program by means of environment variables.
PHP can operate in a web server either as a built-in module (eg mod_php in Apache) or as a CGI program, in which case it will interpret the CGI environment variables and present data to the script in $_GET, $_POST, $_COOKIE, $_SERVER, etc.
let me rephrase the question - is there a particular point inside of index.php that I could snapshot, which would have all the variables needed for a given index.php query, and could I take these variables, set the appropriate CGI environment up, and then run it seamlessly?
Or is there going to be extra-environment information that I'm going to have to acquire (and massage) in order to make this work? I'm primarily thinking cookies here..
I'll give it a whirl, but I'm skeptical. I just tried it, got a '>' as a prompt, hit one question mark (to get help) and it seemed to spawn an infinite loop of '>' prompts.
"?" is not a valid PHP statement.
of course, but I would think that the appropriate response would be to emit a syntax error, not an infinite loop of '>'s . This just leads me to think that it might be not the most 'well-traveled' debugging environment.
No, there's a single code base; they just chose some unfortunate naming for the front-end executables.
... and made it rather difficult to have both flavors resident on your machine at the same time,
In particular (for those who google on CLI and CGI problems with php), to get both cli and cgi, I needed to configure and compile php twice, once --with-apxs=, and once without.
Just curious, but why was php chosen in the first place? The more I look, the more php seems to be tied together with little bits of string and glue.. why not python or mod_perl, or ruby? Or, even c/C++, or *shudder* java?
Why anything? You have to pick something, and somebody's going to bitch about it whatever it is. Perl in particular is twice as ugly as PHP. ;)
;) ok, lets just say that we respectfully disagree here. AFAICT, php is one huge winnebago class, which survives by quick access to a bunch of quick-to-use functionality without needing to import various modules. (perl is a winnebago too, but about 5 times smaller, and perl has much more powerful data manipulation methods.
Ed