http://example.com/script.fcgi?test
Then this script prints nothing:
#!/usr/bin/perl -wuse lib qw( /home/myhome/lib/perl/5.8.4 );
use FCGI;while ( FCGI::accept() >= 0 ) {
print "Content-type:text/html\n\n";
print $ARGV[0];
}
Am I doing something wrong, or is this expected behavior, and if so there has to be a workaround, right? I can't see how FastCGI is viable if you can't pass info via the query string....
[search.cpan.org...]
use FCGI;my $count = 0;
my $request = FCGI::Request();while($request->Accept() >= 0) {
print("Content-type: text/html\r\n\r\n", ++$count);
}
I don't know if you have to implicitly use the Request() function first, but in your code you also have 'accept()' but in the documentation it's Accept() with an upper-case A.
In the doc it says:
FCGI::RequestCreates a request handle. It has the following optional parameters:
input perl file handle (default: \*STDIN)
output perl file handle (default: \*STDOUT)
error perl file handle (default: \*STDERR)These filehandles will be setup to act as input/output/error on succesful Accept.
However, with FastCGI, the perl script is only launched once and following requests go through the FCGI loop. Hence, there is no ARGV.
CGI specification specifies QUERY_STRING environment variable as the correct method to get the query. FCGI emulates this between apache request and FCGI faked out environment