#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    6
    Rep Power
    0

    Premature end..... again....


    I feel bad about asking for help on this topic, cos there is so many other posts about it (mainly in perl though), and I've tried everything but am lost.

    I've got a python script, works fine from command line, but error_log is giving me "Premature end of script headers: index.cgi".

    I'm trying to get to it using Apache/2.0.46 (Unix) mod_perl/1.99_09 Perl/v5.8.0 PHP/4.3.3RC2-dev mod_python/3.0.3 Python/2.2.2 Server

    I've tried permissions, ownership, content-type headers (with first-caps, and not, and with one and two lines after it).

    mod_python should be working as it works on a basic Hello World script.

    Any ideas would be much appreciated.

    Thanks,
    Dave
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    Norway
    Posts
    41
    Rep Power
    11

    import module


    Are you running it as a cgi script and shell script on the same machine?

    I have gotten that error because i tried to import a module that wasn't installed on the server. It was installed on my machine so it worked just fine here.

    If you haven't been there already, the module docs is a good place to learn.
    http://www.python.org/doc/current/lib/module-cgi.html
    Good web hosting info - articles about web hosting
    hb's web dev blog
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    6
    Rep Power
    0
    I figured it out. I was writing it on Windows, saving to Linux, and was using Windows Line breaks.

    Doh!

    Thanx for the reply though, much appreciated.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    Norway
    Posts
    41
    Rep Power
    11
    Ok, that's one more thing to put on the "will cause 500 error list".
    Good web hosting info - articles about web hosting
    hb's web dev blog

IMN logo majestic logo threadwatch logo seochat tools logo