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.

Strange 500 Internal Server Error

Discussion in 'General Discussion' started by Doctor, Sep 2, 2003.

  1. Doctor

    Doctor Well-Known Member

    Joined:
    Apr 26, 2003
    Messages:
    180
    Likes Received:
    0
    Trophy Points:
    16
    On the same server, I have 2 accounts. The first account (A.com) was created months ago while the second account (B.com) was created today.

    I have a script that runs without any problems in A.com. But when I upload the same very script into B.com, I get "500 Internal Server Error" (Premature header...).

    I tried deleting B.com and re-creating it but still get the same error message. Anyone? :confused:

    cPanel.net Support Ticket Number:
     
  2. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    Insert
    Code:
    #!/usr/bin/perl  
    use CGI::Carp qw(fatalsToBrowser); 
    
    at the top of the script and then check the error logs.

    cPanel.net Support Ticket Number:
     
  3. Doctor

    Doctor Well-Known Member

    Joined:
    Apr 26, 2003
    Messages:
    180
    Likes Received:
    0
    Trophy Points:
    16
    The CARP line is already there. Nothing. It just shows "Premature end of header". This only happens after I upgraded CPANEL to its latest RELEASE version.

    Scripts that have been installed run without any problems. Just new scripts... any script... just doesn't work. :(

    cPanel.net Support Ticket Number:
     
  4. kcdworks

    kcdworks Well-Known Member

    Joined:
    Jul 28, 2002
    Messages:
    186
    Likes Received:
    0
    Trophy Points:
    16
    Do this:

    1. cd /path/to/the/script
    2. touch error.txt
    3. chmod 0777 error.txt
    4. open the script in a text editor
    5. remove the CGI::Carp line
    6. Insert this right after the #! line:
    Code:
    BEGIN {
    open (STDERR, ">./error.txt");
    }
    7. Run the script, then check error.txt for the error it gives, and post the results here.

    cPanel.net Support Ticket Number:
     
  5. Doctor

    Doctor Well-Known Member

    Joined:
    Apr 26, 2003
    Messages:
    180
    Likes Received:
    0
    Trophy Points:
    16
    Solve the problem. Not sure why but the script won't run if I use:

    #!/usr/bin/perl

    ...but it runs fine if I use:

    #!/usr/bin/perl -w

    Hmm... all along my scripts run fine with the first syntax but suddenly only the second syntax works. Beats me!

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page