I have a cgi which calls a MySQL database. It runs perfectly on Windows Server 2003 with Apache 1.3. However on Windows Server with Apache 2.2 I get an Internal Server Error as follows:Bad file descriptor; don't know how to spawn child process: E:/Dirctory Name/cgiprogram.pl is not executable; ensure interpreted scripts have "#! first line.

Here's the beginning of the code:

#!C:/Perl/bin/perl -w use DBI; use CGI ':standard'; print "Content-type: text/html\n\n"; # constants my $dbh = DBI->connect('dbi:mysql:jobs_db','jobseeker','jobseekerpassw +d') or die "Connection Error: $DBI::errstr\n"; $sth = $dbh->prepare ("DELETE FROM jobs WHERE DateAdded < DATE_SUB(NOW +(), INTERVAL 30 DAY)"); $sth->execute (); my $pagesize = 5; # variables my $AccountID=param('AccountID'); my $locn= param('Country'); my $Function = param('Specialty'); my $reqpage = param('reqpage') || 1; if ($Function eq ""||$locn eq "Select") { print "The FORM is INCOMPLETE. Please Go Back And Fill In All Fields." +; } else { # connect to database my $dbh = get_dbh();

Why doesn't this run on the new server? Any insight will be sincerely appreciated.


In reply to Bad File Descriptor by Milti

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.