#!C:/perl/bin/perl.exe
use CGI;
my $q = CGI->new;
print $q->header('text/plain'),
"Hello ", $q->param('name');
#CONVERTED PSGI PAGE
#!C:/perl/bin/perl.exe
use CGI::PSGI;
my $app = sub {
my $env = shift;
my $q = CGI::PSGI->new($env);
return [
$q->psgi_header('text/plain'),
[ "Hello ", $q->param('name') ],
];
};
I run this cgi.pl in apache server as http://localhost/cgi-bin/cgi.pl
but I cant able to run the converted psgi.pl in apache server its displaying please help Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log.
CGI- is one specification what uses the Apache and/or other web-servers.PSGIis another specification. You can runCGIapplications under the PSGI-servers (by usingCGI::PSGI), but you can't run an PSGI application as plain CGI-script. For PSGI app you dont need apache. (if want use apache, you could: 1.) run your PSGI app behind reverse proxy, or 2.) use Plack::Handler::Apache2 or such... - jm666