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.

Perl problems

Discussion in 'General Discussion' started by jsteel, Sep 15, 2002.

  1. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    My customers have been complaining of perl issues since I re-installed 5.6.1 in an attempt to get Interchange working. We can get PerlDesk to run just fine, but can't get the very simple Perl script below to run (just get Internal Server Error). Any ideas? The perl path is the same in this one as it is in perldesk and it does have global execute permissions. It is simply named hello.cgi. We've also tried hello.pl.

    Jaz

    --------------------------------------------------------------------
    #!/usr/bin/perl

    print &HTTP/1.0 200 OK\n&;
    print &Content-Type: text/html\n\n&;
    print &&HTML&\n&;
    print &&HEAD&\n&;
    print &&TITLE&Hello World&/TITLE&\n&;
    print &&/HEAD&\n&; print &&BODY&\n&;
    print &&H4&Hello World&/H4&\n&;
    print &&P&\n&;
    print &Your IP Address is $ENV{REMOTE_ADDR}.\n&;
    print &&P&&; print &&H5&Have
    a nice day&/H5&\n&;
    print &&/BODY&\n&; print &&/HTML&\n&;
    ---------------------------------------------------------------------
     
  2. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    Nope. Still returns 'Internal Server Error'. The customer reports that script works just fine on another server.

    Jaz
     
  3. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    When I run 'perl hello.cgi' it returns the appropriate output (minus the server variables obvioulsy).

    I think something is really horked with perl. I'm just baffled that pdesk.cgi runs just fine from the same directory (they both have the same permissions).

    WTF?!?!?!?

    Jaz
     
  4. bdraco

    bdraco Guest

    Check the suexec_log in /usr/local/apache/logs/
     
  5. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    It shows the standard info message with the correct uid and gid.
     
  6. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    I have the issue. When ran at command line with perl works fine when called from browser throws server 500. Logs show premature end of script headers
     
  7. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    The problem for us was that they were uploading via CPanel's File Manager and it was uploading them in Binary mode, not ASCII. Once they were re-uploded via an FTP client in ASCII mode, everything was fine. I think Nick was looking at this issue, but not sure of the status.

    Jaz
     
  8. Skm74

    Skm74 Well-Known Member

    Joined:
    Sep 28, 2002
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    I have the same problem but i tested the custoumers script internal error i made one test file uploaded it in ascii chmod 755 and error again WHAT IS WRONG. The preinstalled scripts wprks fine but not the uploaded
     
  9. Website Rob

    Website Rob Well-Known Member

    Joined:
    Mar 23, 2002
    Messages:
    1,506
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    Alberta, Canada
    cPanel Access Level:
    Root Administrator
    I remember being on a Server that had the same problems. Although 5.3 R56 was being used, the problem started when upgrading from version 4 to 5. Not sure of the details as the Server I have now can run those problem scripts, with no problem, no matter where they are. I was also using 5.3 R56 (I'm now using R69 with no problems) off a fresh Server install. Appears the devil is in the details, as they say, and has something to do with the individual setup/customizing of WHM/Cpanel.

    When I was having this problem and even though some scripts were detailed and some were basic (like &Hello World&), I solved the problem by putting the scripts within a dir. All problem scripts running from & /cgi-bin/ & worked just fine when used from & /cgi-bin/directory/ &. This is probably why some do not have a problem with PerlDesk as they are putting it within it's own directory.

    Why do the problem scripts work within their own directory? I have no idea. No matter what troubleshooting method I used, and even if the script code/syntax was perfect, that stupid &premature end of script headers& msg. drove me nuts. The work around mentioned above solved the problem and that's what I wanted. Should work for others as well.
     
  10. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    [quote:77e0aa8b9b][i:77e0aa8b9b]Originally posted by jsteel[/i:77e0aa8b9b]

    My customers have been complaining of perl issues since I re-installed 5.6.1 in an attempt to get Interchange working. We can get PerlDesk to run just fine, but can't get the very simple Perl script below to run (just get Internal Server Error). Any ideas? The perl path is the same in this one as it is in perldesk and it does have global execute permissions. It is simply named hello.cgi. We've also tried hello.pl.

    Jaz

    --------------------------------------------------------------------
    #!/usr/bin/perl

    print &HTTP/1.0 200 OK\n&;
    print &Content-Type: text/html\n\n&;
    print &&HTML&\n&;
    print &&HEAD&\n&;
    print &&TITLE&Hello World&/TITLE&\n&;
    print &&/HEAD&\n&; print &&BODY&\n&;
    print &&H4&Hello World&/H4&\n&;
    print &&P&\n&;
    print &Your IP Address is $ENV{REMOTE_ADDR}.\n&;
    print &&P&&; print &&H5&Have
    a nice day&/H5&\n&;
    print &&/BODY&\n&; print &&/HTML&\n&;
    ---------------------------------------------------------------------[/quote:77e0aa8b9b]

    That's weird. I just copied your code, removed the first print line, uploaded in ascii, and changed permissions to 755 and it worked fine. Try it at http://specialcelebrities.com/cgi-bin/test.cgi if you want. It's your script.
     
  11. ozzi4648

    ozzi4648 Guest

    and it doesnt work on our server either!! Our users are not happy. Scripts that worked for them flawlessly under 5.6.0 DO NOT under 5.6.1. By default our server was a plain RH server with Perl 5.6.0 installed. After the upgrade Perl was upgraded to 5.6.1 but we still see paths leading to 5.6.0 etc.

    I would like to go back to using Perl 5.6.0 just to see if it makes a difference.
     
Loading...

Share This Page