Re: Premature end of script headers

[email protected] ("Mike Williams")
Newsgroups perl.beginners.cgi
Message-ID <[email protected]>
On 6/13/07, [email protected] <[email protected]> wrote:
> >
>         i made changes in httpd.conf file as you mentioned , here is
> mine
>
> <Directory "E:/Program Files/Apache Software Foundation/Apache2.2/cgi-
> bin">
>     AllowOverride None
>     Options None
>     Order allow,deny
>     Allow from all
>     Options ExecCGI
>     AddHandler cgi-script.exe
> </Directory>

Saran,

There is a typo in the Add-Handler statement - you need a space between
cgi-script and .exe:
AddHandler cgi-script  .exe

Make sure you also have a Script-Alias for cgi-bin
Mine looks like this:
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

The comments in the apache file contain important information and are
worth reading.

After changing the httpd.conf file you should always do:
apachectl -t
# to test the configuration file - you will get an error message if
there is a problem

# if no error message, then do
apachectl reload
# that will cause apache to reload the new configuration file, otherwise your
# changes will not take effect

Note - BOTH of the above steps should always be done after changing httpd.conf
Otherwise you could make a change that will break your configuration and not
realize until much later and find yourself wondering why apache did not start.
You should always make a copy of httpd.conf before making changes.

I am not certain if this works the same way on windows, you may have
to read the fine manual.  If you have apache running as a service then
stopping then restarting the service will get the configuration
changes loaded.

> do you made any modification to make the code run on linux,if so let
> me know

The code you originally posted compiled and ran without modification on linux.

Mike
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.