Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member This forum account has been confirmed by cPanel staff to represent a vendor. Radio_Head's Avatar
    Join Date
    Feb 2002
    Posts
    2,064

    Default Internal server error

    When I run this simple perl script from web....

    #!/usr/bin/perl
    open(SENDMAIL, &|/usr/sbin/sendmail -t -odi&amp 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 SPAM & VIRUS :: ASSP Deluxe for cPanel http://www.grscripts.com
    █ ASSP Deluxe is supported by Fritz Borgstedt,ASSP main developer.

  2. #2
    Member
    Join Date
    May 2002
    Posts
    249

    Default

    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. #3
    Member
    Join Date
    Jan 2002
    Posts
    148

    Default

    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. #4
    Member This forum account has been confirmed by cPanel staff to represent a vendor. Radio_Head's Avatar
    Join Date
    Feb 2002
    Posts
    2,064

    Default

    [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 SPAM & VIRUS :: ASSP Deluxe for cPanel http://www.grscripts.com
    █ ASSP Deluxe is supported by Fritz Borgstedt,ASSP main developer.

  5. #5
    Member This forum account has been confirmed by cPanel staff to represent a vendor. Radio_Head's Avatar
    Join Date
    Feb 2002
    Posts
    2,064

    Default

    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 SPAM & VIRUS :: ASSP Deluxe for cPanel http://www.grscripts.com
    █ ASSP Deluxe is supported by Fritz Borgstedt,ASSP main developer.

Similar Threads & Tags
Similar threads

  1. 403 Forbidden Error / 500 Internal Server Error
    By saurabhnsonar in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 11-29-2010, 08:45 AM
  2. Error with cgi-bin 500 internal server error
    By approx in forum cPanel and WHM Discussions
    Replies: 13
    Last Post: 03-11-2009, 11:13 PM
  3. Internal Server Error
    By shibucvarughese in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 10-04-2005, 06:39 AM
  4. error 500 internal server error on movable type
    By spoiledbrattine in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-04-2005, 01:15 PM
  5. Replies: 10
    Last Post: 10-30-2004, 04:08 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube