httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BAO RuiXian <ruixian....@pp.inet.fi>
Subject [users@httpd] CGI scripts with nph_ prefix and Apache
Date Mon, 28 Jun 2004 21:02:41 GMT
Hello,

    When I tested nph (Non-Parsed Header) CGI scripts, I mistakingly 
wrote nph- as nph_ for a CGI script. With this nph_ prefixed CGI script, 
I got an Internal Server Error after couple of minutes on either the 
browser IE 6.0 or Netscape 7.1, and the error_log contain this line 
"[Mon Jun 28 23:06:22 2004] [error] [client 127.0.0.1] malformed header 
from script. Bad header=HTTP/1.1 200 OK: nph_count.pl". Of course, after 
I renamed the prefix from nph_ to nph-, the script runs no problem on 
both browsers. I read from somewhere that nowadays Apache does not need 
nph CGI to speed up response time anymore (verified this by renaming the 
script without nph- prefix, no difference). But, is this an expected 
behaviour for Apache with nph_ prefixed CGI scripts.

    My environments are Windows 2000, Apache/2.0.47 (Win32) PHP/4.3.3 
mod_ssl/2.0.47 OpenSSL/0.9.7c Server at localhost Port 80.

    The script is taken from the book "CGI Programming on the World Wide 
Web" by Shishir Gundavaram (1996), a bit old though but doesn't matter 
regarding this problem.

    The script I tested with nph prefix as follows:

#!F:/perl/bin/perl
$server_protocol = $ENV{'SERVER_PROTOCOL'};
$server_software = $ENV{'SERVER_SOFTWARE'};
print "$server_protocol 200 OK", "\n";
print "Server: $server_software", "\n";
print "Content-type: text/plain", "\n\n";
print "OK, Here I go. I am going to count from 1 to 50!", "\n";
$| = 1;
for ($loop=1; $loop <= 50; $loop++) {
        print $loop, "\n";
        sleep (2);
}
print "All Done!", "\n";


  And the script without nph as follows (to test the difference made by nph prefix, 
not related to my puzzle):

#!F:/perl/bin/perl
print "Content-type: text/plain", "\n\n";
print "OK, Here I go. I am going to count from 1 to 50!", "\n";
$| = 1;
for ($loop=1; $loop <= 50; $loop++) {
        print $loop, "\n";
        sleep (2);
}
print "All Done!", "\n";


Best

Bao
exit (0);





---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message