CGI script not working anymore

Discussion in 'Apache' started by julien_santini, Sep 19, 2010.

  1. #1
    Hello,

    I've been using mimetex.cgi (a script written in C) in order to render Latex on my forums for years, but this script stopped functioning a couple of days ago (I now get a 500 internal server error, and yes I have checked all permissions and the file was transferred in binary mode; I even recompiled it locally on my Linux machine and ran it from the command line and it worked just fine)

    Additionally, some admin of my webhost told me that he read in the error log:
    "malformed header from script. Bad header=mimetex.cgi: mimetex.cgi", which I find a little puzzling since the script is an executable (already compiled) therefore I don't know why there would be any header problem ?

    If you are familiar with this issue your help would be greatly appreciated !

    Best regards
    Julien
     
    julien_santini, Sep 19, 2010 IP
  2. ramnet

    ramnet Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If your host offers shell access on request you can ask for that and try running the script and see how it behaves.

    Alternatively (if your host won't give you shell access), you could try wrapping the script inside another script for debugging purposes like so:

    
    #!/bin/sh
    echo "Content-Type: text/plain"
    echo "Pragma: no-cache"
    echo "Expires: -1"
    echo ""
    
    /path/to/your/script/mimetex.cgi
    
    Code (markup):
    Upload that and call it through your browser and it should become clear what the problem is.
     
    ramnet, Sep 20, 2010 IP