Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

NPH Scripts on Apache under Win32

by vbrtrmn (Pilgrim)
on Feb 23, 2002 at 11:50 UTC ( [id://147060]=perlquestion: print w/replies, xml ) Need Help??

vbrtrmn has asked for the wisdom of the Perl Monks concerning the following question:

I was wondering if there are any issues running NPH scripts on Apache under Win32. Here's a generic test script, which I've been messing with:
#!perl.exe print "$ENV{'SERVER_PROTOCOL'} 200 OK\n"; print "Server: $ENV{'SERVER_SOFTWARE'}\n"; print "Content-type: text/plain\n\n"; $| = 0; for ($loop = 10; $loop >= 0; $loop--) { print "$loop\n"; sleep (1); } print "Blast Off!\n"; exit (0);
It seems to work okay on my Mandrake box and Cobalt RaQ, but not so well on my windows machine... and no, perl.exe is not in my cgi-bin :)
See it not work here: http://66.149.100.92/cgi-bin/nph-test.cgi
--
paul

Replies are listed 'Best First'.
Re: NPH Scripts on Apache under Win32
by gellyfish (Monsignor) on Feb 23, 2002 at 13:13 UTC

    Actually it works fine for me with Galeon - but I think the problem you are seeing is because you need to output proper carriage return / line feed pairs in the header and not just "\n" - you can probably replace the "\n"s in the header with "\r\n" or "\xOD\xOA" more exactly

    /J\

      Using the Mozilla & IE browsers under windows.. Content-type: text/plain\r\n returns the save file dialog. Content-type: text/plain\x0D\x0A (those are zeros) returns the same. Content-type: text/plain\r\r returns the same. Content-type: text/plain\x0D\x0D (those are zeros) returns the same. Content-type: text/plain\xOD\xOD (those are oh's) returns a blank page. Content-type: text/plain\xOD\xOA (those are oh's) returns a blank page.
      --
      paul

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://147060]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-03-28 22:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found