Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Internal server error

Discussion in 'General Discussion' started by Radio_Head, Sep 4, 2002.

  1. Radio_Head

    Radio_Head Well-Known Member

    Joined:
    Feb 15, 2002
    Messages:
    2,051
    Likes Received:
    1
    Trophy Points:
    343
    When I run this simple perl script from web....

    #!/usr/bin/perl
    open(SENDMAIL, &|/usr/sbin/sendmail -t -odi&) or die &error: $!\n&;
    print SENDMAIL &&&EOF&;
    From: TestFrom &info\@domain.com&
    To: test &test\@domain.com&
    Subject: mail test
    test
    eof
    close (SENDMAIL) or die &sendmail didn't close nicely&;
    exit;


    ... I receive an internal server error (however I receive the Email) .
    If I execute above script from command line it works fine , no error . Why ? Thanks
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. SHSaeed

    SHSaeed Well-Known Member

    Joined:
    May 9, 2002
    Messages:
    245
    Likes Received:
    0
    Trophy Points:
    316
    Your script is not printing anything to the browser, not even sending a header..

    Try adding..

    print &Content-type: text/html\n\n&;
    print &Hello World&;

    to the bottom (before the exit;)..
     
  3. gorgo

    gorgo Well-Known Member

    Joined:
    Jan 9, 2002
    Messages:
    148
    Likes Received:
    0
    Trophy Points:
    316
    with perl scripts, it's end task is to display something... when your web browser requests the page, it asks for something back. Since the Perl script has nothing to display to the web browser, it just crashes out like you showed...

    So just remember, perl must ALWAYS have a content-type, and must always output something when a browser calls ;)
     
  4. Radio_Head

    Radio_Head Well-Known Member

    Joined:
    Feb 15, 2002
    Messages:
    2,051
    Likes Received:
    1
    Trophy Points:
    343
    [quote:82344361e7][i:82344361e7]Originally posted by (SH)Saeed[/i:82344361e7]

    Your script is not printing anything to the browser, not even sending a header..

    Try adding..

    print &Content-type: text/html\n\n&;
    print &Hello World&;

    to the bottom (before the exit;)..[/quote:82344361e7]

    Hello ,

    Thank you ( I am a php lover ;) )...

    however I added

    print &Content-type: text/html\n\n&;
    print &Hello World&;

    to the bottom (before the exit..

    but I am still receiving an Internal server error , using the browser ... (no error from command line) ..


    Thank you
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Radio_Head

    Radio_Head Well-Known Member

    Joined:
    Feb 15, 2002
    Messages:
    2,051
    Likes Received:
    1
    Trophy Points:
    343
    ok now works ;)

    Now , I am trying to execute a cron job on it but it doesn't work.
    Perhaps because there are anti spam restrictions ?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice