LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-28-2004, 09:36 AM   #1
FreakFish
LQ Newbie
 
Registered: Apr 2004
Location: China
Distribution: Fedora One
Posts: 8

Rep: Reputation: 0
Unhappy my CGI problem...


hi!: i'm using FC1 and apache 2.0.48, i installed perl5.83

i modified my httpd.conf file properly already, and those *cgi files that i download from internet when i try to test them in my browser

htt-p://127.0.0.1/cgi-bin/test.cgi for example

it always give me 500 Error!! i've changed permission into 777 or 755 already.

BUT! when i use gftp to download the same file to my machine, and it runs without any problem!

the question is how could i test those cgi files originally on my machine work via apache??


thank you!!
 
Old 04-28-2004, 01:11 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
What error are you getting in your apache "error_log"?
 
Old 04-30-2004, 08:49 AM   #3
FreakFish
LQ Newbie
 
Registered: Apr 2004
Location: China
Distribution: Fedora One
Posts: 8

Original Poster
Rep: Reputation: 0
the error from error_log is

"[Sat May 01 01:10:17 2004] [error] [client 127.0.0.1] Premature end of script headers: perldiver.cgi"

and

#!/usr/bin/perl



# Note: This program currently cannot run with -T. The Module::Info module

# does not perform taint checking. However, all user input is taint-checked

# in Perl Diver.



use lib '.';

do 'perldiver.conf' or die "Can't load conf file $!";





BEGIN{

$ENV{'PATH'} = '/bin:/usr/bin';

delete @ENV{ 'IFS', 'CDPATH', 'ENV', 'BASH_ENV' };

}


......

is the original beginning of the cgi file. i downloaded the a .zip file from Internet.

The problem is solved by just simply adding -w after the first line which is

#!/usr/bin/perl

now i changed it into

#!/usr/bin/perl -w

and it could work!

but the question still i can't figure out, why when the same file i downloaded by using gFTP can be excuted successfully, but the file i just downloaded by clicking the link in web browser doesn't work??

if i'd like to test those cgi files in my harddriver, do i need to add "-w" to the first line of each file manually??
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CGI to work out side of cgi-bin? crashedspine Linux - Newbie 13 09-02-2004 08:49 PM
CGI Problem amit_28oct Programming 2 03-23-2004 09:50 PM
perl problem? apache problem? cgi problem? WorldBuilder Linux - Software 1 09-17-2003 07:45 PM
cgi problem jstu Programming 2 12-26-2002 10:28 PM
http://www.burstnet.com/cgi-bin/ads/ad7954a.cgi/3980/RETURN-CODE rverlander LQ Suggestions & Feedback 1 06-07-2002 07:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration