Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 92353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:10:25+00:00 2026-05-10T23:10:25+00:00

I am trying to set up apache instead of IIS because IIS needlessly crashes

  • 0

I am trying to set up apache instead of IIS because IIS needlessly crashes all the time, and it would be nice to be able to have my own checkout of the source instead of all of us editing a common checkout.

In IIS we must do something like this at the beginning of each file:

use CGI; my $input = new CGI(); print 'HTTP/1.0 200 OK'; print $input->header(); 

whereas with apache we must leave off the 200 OK line. The following works with both:

use CGI; my $input = new CGI(); print $input->header('text/html','200 OK'); 

Can anyone explain why? And I was under the impression that the CGI module was supposed to figure out these kind of details automatically…

Thanks!

Update: brian is right, nph fixes the problem for IIS, but it is still broken for Apache. I don’t think it’s worth it to have conditionals all over the code so I will just stick with the last method, which works with and without nph.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T23:10:25+00:00Added an answer on May 10, 2026 at 11:10 pm

    HTTP and CGI are different things. The Perl CGI module calls what it does an ‘HTTP header’, but it’s really just a CGI header for the server to fix up before it goes back to the client. They look a lot alike which is why people get confused and why the CGI.pm docs don’t help by calling them the wrong thing.

    Apache fixes up the CGI headers to make them into HTTP headers, including adding the HTTP status line and anything else it might need.

    If you webserver isn’t fixing up the header for you, it’s probably expecting a ‘no-parsed header’ where you take responsibility for the entire header. To do that in CGI.pm, you have to add the -nph option to your call to header, and you have to make the complete header yourself, including headers such as Expires and Last-Modified. See the docs under Creating a Standard HTTP Header. You can turn on NPH in three ways:

    use CGI qw(-nph)  CGI::nph(1)  print header( -nph => 1, ...) 

    Are you using an older version of IIS? CGI.pm used to turn on the NPH feature for you automatically for IIS, but now that line is commented out in the source in CGI.pm:

    # This no longer seems to be necessary # Turn on NPH scripts by default when running under IIS server! # $NPH++ if defined($ENV{'SERVER_SOFTWARE'}) && $ENV{'SERVER_SOFTWARE'}=~/IIS/; 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 65k
  • Answers 65k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer I don't think you're going to get a better explanation… May 11, 2026 at 11:10 am
  • added an answer I think it's DataTypeEnum of OLE DB types. May 11, 2026 at 11:10 am
  • added an answer try using this, I think it is the effect that… May 11, 2026 at 11:10 am

Related Questions

I am trying to set up apache instead of IIS because IIS needlessly crashes
I am trying to set up my tab order on the html side of
I am trying to set up a simple transaction for my Linq-to-Sql actions against
I am trying to set up a Continuous Integration process. For my various build
I am trying to to set up the login control to remember the login
Ok, so I am trying to set up a Dispatcher with mod_perl and I
I am trying to set myself up on a mac to learn Ruby on
Im trying to set up a session and i am getting a header error,
I set up all my certificates and keys today and am trying to run
I am trying to setup tracd for the project I am currently working on.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.