The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

CGI scripts not running at all...

Discussion in 'General Discussion' started by ircmaxell, Jul 11, 2006.

  1. ircmaxell

    ircmaxell Member

    Joined:
    Mar 20, 2006
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    I've got 2 cgi files in my cgi-bin that will not run via http (they run fine command line). I cannot get ANY cgi files to run in cgi-bin via http...
    http://www.bigtrue.com/cgi-bin/header.cgi (a php based script)
    http://www.bigtrue.com/cgi-bin/header2.cgi (a perl based script)

    They are as simple as can be, but just won't run. I keep getting a 500 error. When looking at the logs, Premature End Of Script Headers. I've checked permissions, file type (unix vs windows linefeeds), syntax, spaces, etc... I am totally lost!
    Header.cgi :

    Header2.cgi

    for the php script, I also tried using the header() function, with the same results...
     
  2. WebScHoLaR

    WebScHoLaR Well-Known Member

    Joined:
    Dec 14, 2005
    Messages:
    511
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Planet Earth
    Have you checked the error that Apache is reporting while executing these scripts? You can check the apache error log at /usr/local/apache/logs/error_log but it requires root access.
     
  3. ircmaxell

    ircmaxell Member

    Joined:
    Mar 20, 2006
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Yes I have... All it says is "Premature End Of Script Headers"...
     
  4. WebScHoLaR

    WebScHoLaR Well-Known Member

    Joined:
    Dec 14, 2005
    Messages:
    511
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Planet Earth
    Make sure that you have uploaded the scripts in the ASCII format and their permissions are 755.
     
  5. ircmaxell

    ircmaxell Member

    Joined:
    Mar 20, 2006
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Well, I created them in VI, and they do have permissions of 755. I assume that VI defaults to ASCII. This is why I am lost...
     
  6. remik

    remik Guest

    ircmaxell: have You solved the problem? I have the same thing on 2 of my servers.
    Bash scripts don't run either. I have noticed that compiled ELF executables run just fine..
     
  7. brunomenoli

    brunomenoli Active Member

    Joined:
    Sep 2, 2005
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brazil
    I have te problem too :(
     
  8. brunomenoli

    brunomenoli Active Member

    Joined:
    Sep 2, 2005
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Brazil
    My problema ix fixed,

    The permissions files cannot be 777, I set 755 is works> See the file:



    /usr/local/apache/logs/suexec_log
     
Loading...

Share This Page