Perl

Moderators: Jonathan
Number of threads: 1259
Number of posts: 3644

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Internal Server erro Posted by DavidJackson4 on 6 Feb 2004 at 8:22 PM
I am trying to write a hello world Perl/CGI program.

When I go to the file on the web it says "Internal Server error"

I have already changed the permissions on helloworld.pl and I am pretty sure that I have the right #! line at the beginning. Any ideas what could be wrong?


Report
Re: Internal Server erro Posted by Xfactor on 6 Feb 2004 at 10:52 PM
This message was edited by Xfactor at 2004-2-6 22:57:8

: I am trying to write a hello world Perl/CGI program.
:
: When I go to the file on the web it says "Internal Server error"
:
: I have already changed the permissions on helloworld.pl and I am pretty sure that I have the right #! line at the beginning. Any ideas what could be wrong?

We have to see your code but make sure you have the print statement:

print "Content-type: text/html\n\n";

This needs to be placed before your other perl code. If this isn't the problem, you'll need to post your code.
Report
Re: Internal Server erro Posted by Jonathan on 7 Feb 2004 at 2:51 AM
: This message was edited by Xfactor at 2004-2-6 22:57:8

: : I am trying to write a hello world Perl/CGI program.
: :
: : When I go to the file on the web it says "Internal Server error"
: :
: : I have already changed the permissions on helloworld.pl and I am pretty sure that I have the right #! line at the beginning. Any ideas what could be wrong?
:
: We have to see your code but make sure you have the print statement:
:
: print "Content-type: text/html\n\n";
:
: This needs to be placed before your other perl code. If this isn't the problem, you'll need to post your code.
:
Or more specifically, it has to be before any other print statement.

Also, if you FTP'd the file up, make sure you did so in ASCII mode, otherwise you'll run into issues with different line endings, which also results in an Internal Server Error.

Do you have access to the server's error log? If so, it can often provide valuable insight into the problem - just grep it for the name of your script (if you have that kinda access to it).

Jonathan

###
for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
(tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
/(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

Report
Re: Internal Server erro Posted by Weirdofreak on 7 Feb 2004 at 2:23 PM
My first guess would be that the script isn't communicating with Perl. Telnet in, and try a whereis to be sure. The content-type thing should just mean that it displays as HTML, not plaintext - leave it out and you get the equivalent of a .txt file, which wouldn't be a problem with a simple hello world.
Report
Re: Internal Server erro Posted by Jonathan on 7 Feb 2004 at 3:43 PM
: The content-type thing should just mean that it displays as HTML,
: not plaintext - leave it out and you get the equivalent of a .txt
: file, which wouldn't be a problem with a simple hello world.
:
Sometimes yes, sometimes no. I've come accross a whole range of things that can happen if you don't add a valid header, including:-

- Server supplies a text/html one so it displays as HTML
- Server supplies a text/plain one so it displays as text
- Server says "no headers, no play" and gives a 500 error

I'm pretty sure I've seen all three of these happen accross various servers I've had the pleasure (or displeasure) of working with.

Jonathan

###
for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
(tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
/(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.