[quote]I created a folder cgi-bin in my domain-dir, placed a small test script in it
chmod 755 -R cgi-bin
tells me /usr/bin/perl
In this forum and the wiki I found many people having problems with access rights, so I did a chmod 777 on the files, but this didn’t do the trick.[/quote]
Here is what happens when your run a CGI script:
- The web server sets up a “CGI environment” and then executes the script.
- The “perl” program runs your script
- The web server expects the script output to start with headers followed by a blank line followed by the content to pass along to the web browser.
From the error message you can tell that the failure is with step #2 or step #3. From your code, it is apparent that it is at least step #3 - you did not output a set of headers.
At the minimum you need a Content-Type header. Observe.
$mime_type = ‘text/html’;
$header_content_type = “Content-Type: $mime_type\n”;
@headers = ($header_content_type);
$blank_line = “\n”;
$content = “
The reason you get “premature end of headers” messages is because the output the web server sees is not a set of headers. Other than skipping the headers like your script does, you can also get this message if the perl program has a problem interpreting your code (syntax errors, etc) or crashing.
openvein.org -//- One-time [color=#6600CC]$50.00 discount[/color] on [color=#0000CC]DreamHost[/color] plans: Use ATROPOS7