Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 14th, 2004, 9:48 PM   #1
LuXaNa
Newbie
 
Join Date: Sep 2004
Posts: 1
Rep Power: 0 LuXaNa is on a distinguished road
Hello,

I'm trying to run some simple hollo world cgi scripts form my local apache server but I alwayse get error mesage saying :
------------------------
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
---------------------
content of script:
cat test.cgi
#!/usr/bin/perl

use CGI;

$co = new CGI;

print $co->header,

$co->start_html(-title=>'CGI Example'),
$co->center($co->h1('Wlcome to CGI!')),
$co->start_form(),
$co->textarea
(
-name=>'textarea',
-rows=>10,
-columns=>60
),
$co->end-form(),
$co->end-html;

apache log error:
[Wed Sep 15 22:43:43 2004] [error] [client 127.0.0.1] Premature end of script headers: /usr/lib/cgi-bin/test.cgi

The prpblem is that I took this example from book which I took aas tutorial to cgi perl programming. for expample this cript works:

#!/usr/bin/perl

use strict;
use warnings;

print "Content-type: text/plain\n\n";
print "hello world\n";

and I can get printed line hello world on my browser

thanks averyone for help

Luxana
LuXaNa is offline   Reply With Quote
Old Sep 15th, 2004, 2:21 AM   #2
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 5 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
are you sure you can use this programing type with the server you are on?
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity."

- Albert Einstein
Berto is offline   Reply With Quote
Old Sep 15th, 2004, 10:52 AM   #3
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
He's using a local Apache server - there's no reason why he shouldn't.

BTW, I hope you're a He...
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Sep 15th, 2004, 10:53 AM   #4
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,623
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
one probably that it could be is that the file is not set to be executable. make sure that the webserver can execute the program if that is already set i will take another look at the code
__________________
BIG K aka Kyle
Programming Forums
Kyle K Online

Please do not PM or email me programming questions. Post them in the forums instead.
big_k105 is offline   Reply With Quote
Old Sep 15th, 2004, 11:09 AM   #5
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 5 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
make sure it is in the place you think it should be? and in a CGI directory?
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity."

- Albert Einstein
Berto is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:16 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC