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

  • Home
  • SEARCH
  • 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 6125089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:12:27+00:00 2026-05-23T16:12:27+00:00

#!C:\xampp\apache\bin\httpd.exe $command=`perl -v`; $title = Perl Version; print Content-type: text/html\\n\\n; print <html><head><title>$title</title></head><body>; print <h1>$title</h1>

  • 0
#!C:\xampp\apache\bin\httpd.exe
$command=`perl -v`;
$title = "Perl Version";

print "Content-type: text/html\\n\\n";
print "<html><head><title>$title</title></head><body>";

print "
<h1>$title</h1>

\n";
print $command;

print "</body></html>";

I get this error:

Premature end of script headers:
version.cgi

  • 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. Editorial Team
    Editorial Team
    2026-05-23T16:12:27+00:00Added an answer on May 23, 2026 at 4:12 pm

    You need to remove the extra backslash

    This code:

    print "Content-type: text/html\\n\\n";
    

    Should be this:

    print "Content-type: text/html\n\n";
    

    EDIT

    Also, the first line in the script looks wrong.

    #!C:\xampp\apache\bin\httpd.exe
    

    This should be the path to Perl, not httpd.

    EDIT 2

    Finally, this all would have been easier for you to solve if you added these two lines after the first line in your script:

     use strict;
     use warnings;
    

    And run the script on the command line with the -c -w flags to compile-check and warnings-check your script, ie perl -cw yourscript.cgi. This will give you line numbers of errors and warnings in your script.

    Altogether, your script could look like this:

    #!C:\path\to\perl.exe
    
    use strict;
    use warnings;
    
    my $command=$^V;
    my $title = 'Perl Version';
    
    print "Content-type: text/html\r\n\r\n";
    print "
    <html><head><title>$title</title></head><body>
    
    <h1>$title</h1>
    
    $command
    
    </body></html>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have changed the php.ini file in the location (C:\xampp\apache\bin\php.ini) for Xampp and restart
Apache: v.2.2.14 PHP: 5.3.1 PostgreSQL: 8.4 XAMPP: version 1.7.3
I have Apache installed with the XAMPP package, and I'm working locally. I have
in windows (using apache as server), my file path directory will be C:\xampp\htdocs\mysvn\PhpDocumentor\phpdoc.php. But
I developed a Drupal site on XAMPP. I deployed it to an Apache webserver
I try to publish multiple existing mercurial repository-locations though XAMPP Apache via CGI Python
I have enabled mod_rewrite in my Xampp Apache. When I run my phpinfo() page,
I'm running Apache(XAMPP package) and i'm trying to allow forward slashes in the URI
After asking this question ( XAMPP Mercurial installation on Windows Apache --> HgWebDir.cgi Script
I've been trying to get MOD_WSGI working on Apache via XAMPP on my Mac

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.