CGI Error

perl India
  • 14 years ago

    Hi everyone,
    I recently switched to PERL - CGI and actually don't know how to start using CGI.
    I am trying to execute a Hello World cgi script but continuously getting an internal server error.
    However when I run the same script on my localhost I don't get any error.
    Following is the script I am using


    print "Content-type: text/html\n\n";
    print <<HTML;
    <title>A Simple Perl CGI</title>
    <h1>A Simple Perl CGI</h1>
    <p>Hello World</p>

    When I execute this script with .pl extension it gives me proper result but when I execute it with .cgi extension its throwing the internal server error.

    Help me folks :(

    Thanks in advance

    I 4 INDIAN

    ps: I have tried almost all the options that I was able to find on net regarding 500 Internal Server Error

  • 14 years ago
    Hi everyone
    Again after googling a more I found out that in suexec_log file I am getting a error

    mismatch with directory (2523/10001) or program (2523/0)

    Hope this could give you people some hint...
    waiting for replies desperately

    Thanks again
    I 4 INDIAN

  • 14 years ago
    Hi everyone!
    I got a workaround the issue. The main cause of my error was suexec wrapper that we use with
    Apache web server for execution of cgi scripts and other applications.
    And by default it checks for certain permissions which needs to be satisfied before executing
    the CGI scripts. Though I could not satisfy suexec Sad [:(] but I found that if we disable suexec my scripts worked fine Smiley Face [:)]. So I finally decided to disable suexec and my scripts are working fine.

    So if anyone is having any similar issue you can just disable suexec wrapper and have your scripts working.

    By default suexec is in the sbin directory , to disable it you just need to remove it from that path and restart the Apache Web Server.

    To learn more about Suexec you can visit

    Hope this might help some one.

    Thank you all

    I 4 INDIAN

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“In order to understand recursion, one must first understand recursion.”