LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 06-10-2006, 11:46 PM   #1
newuser455
Member
 
Registered: May 2004
Location: Texas
Posts: 277

Rep: Reputation: 30
CGI script 500 error


I am having the hardest time with certain CGI/Perl scripts on my server. Some will run, and some return a 500 error. Right now I need to get this script to work, but it returns a 500 error, while a script like this one works fine. I checked permissions on the one I cannot get working, and made sure it was uploaded in ASCII mode, yet it still refuses to work properly. Could someone look at the 2 scripts I have provided and see if maybe they can figure out what might be causing this problem? I am guessing it has to do with the server configuration, because I have had this script, along with others I have tried work on other servers. Thank you. I would greatly appreciate any help.

Last edited by newuser455; 06-10-2006 at 11:52 PM.
 
Old 06-11-2006, 04:48 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,429

Rep: Reputation: 100Reputation: 100
what os and server is the script running on? on my box it works. may be a problem to give names of directories thru a form if working on a windoze - but just guessing...
 
Old 06-11-2006, 08:44 AM   #3
newuser455
Member
 
Registered: May 2004
Location: Texas
Posts: 277

Original Poster
Rep: Reputation: 30
I am using CentOS 4.2 on this machine, with perl 5.8 I believe.
 
Old 06-11-2006, 08:48 AM   #4
newuser455
Member
 
Registered: May 2004
Location: Texas
Posts: 277

Original Poster
Rep: Reputation: 30
I just had a thought. Apache is configured to use mod_perl to execute perl and CGI scripts. Could this have something to do with it?
 
Old 06-11-2006, 10:01 AM   #5
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,429

Rep: Reputation: 100Reputation: 100
i wonder why u dont get a more precise error message as "fatalsToBrowser" are used. Take a closer look at apache error_log and post what u find here. (maybe in /var/log/apache2/error_log?)
 
Old 06-11-2006, 12:45 PM   #6
newuser455
Member
 
Registered: May 2004
Location: Texas
Posts: 277

Original Poster
Rep: Reputation: 30
I checked there, here is what it says:

Quote:
[Sun Jun 11 12:44:30 2006] [error] [client [my ip]] (2)No such file or directory: exec of '/home/httpd/vhosts/[my vhost]/cgi-bin/setup.cgi' failed
[Sun Jun 11 12:44:30 2006] [error] [client [my ip]] Premature end of script headers: setup.cgi
 
Old 06-11-2006, 01:16 PM   #7
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
did you verify the permissions of /home/httpd/vhosts/[my vhost]/cgi-bin? make sure the dir is allowing apache access.
 
Old 06-11-2006, 01:35 PM   #8
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,429

Rep: Reputation: 100Reputation: 100
i dont have the time to go thru the script again but as far as i remember the user directory is sent by form. this directory probably doesnt extist or isnt writable for the apache user - i'm guessing...
 
Old 06-11-2006, 01:56 PM   #9
newuser455
Member
 
Registered: May 2004
Location: Texas
Posts: 277

Original Poster
Rep: Reputation: 30
I finally got the script to work.

1) Installed CGI.pm.
2) Changed perl path to "/usr/bin/perl -w" (won't work without the -w)
 
  


Reply

Tags
cgi, errors, perl


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Perl-CGI 500 Error tzarcone Programming 1 07-01-2005 02:45 AM
RH 8.0 CGI 500 error (apache) 3Dxx Linux - General 46 06-27-2005 05:51 AM
Apache & CGI error 500 sortia Linux - Newbie 2 01-24-2005 11:38 AM
HELP! CGI problem : HTTP 500 - Internal server error eech55 Programming 2 10-11-2004 11:27 AM
Premature End of Script Headers (Error 500) bsdb3 Red Hat 5 05-06-2004 11:55 AM


All times are GMT -5. The time now is 11:52 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration