It is currently Tue, 17 May 2022 02:13:33 GMT



 
Author Message
 Help:apache did not run perl script
I am learning to write simple cgi scripts. I could not get it to run on my
Liunx apache. I can view web pages in /home/httpd/html directory, but I put
some perl scripts in /home/httpd/cgi-bin, every time I tried to go
http://myserver/cgi-bin/script, I got an access error message, in the error
log it like this: "GET /cgi-bin/howdy.pl HTTP/1.1" 500 534".
What is wrong and what should I do?
My system: RedHat 6.1, Apache 1.3

Thanks in advance.

Yijian at yiji...@hotmail.com



 Wed, 18 Jun 1902 08:00:00 GMT   
 Help:apache did not run perl script
From: Yijian Cao <yiji...@hotmail.com>

I am learning to write simple cgi scripts. I could not get it to run
 on my
Liunx apache. I can view web pages in /home/httpd/html directory, but
 I put
some perl scripts in /home/httpd/cgi-bin, every time I tried to go
http://myserver/cgi-bin/script, I got an access error message, in the
 error
log it like this: "GET /cgi-bin/howdy.pl HTTP/1.1" 500 534".
What is wrong and what should I do?
My system: RedHat 6.1, Apache 1.3

Thanks in advance.

Yijian at yiji...@hotmail.com



 Wed, 18 Jun 1902 08:00:00 GMT   
 Help:apache did not run perl script
From: lba...@mindspring.com (ljb)

Look in the error log, not the access log, for more information.
A 500 error is a server problem; with CGI scripts it often means
something went wrong before the script could write headers back.



 Wed, 18 Jun 1902 08:00:00 GMT   
 Help:apache did not run perl script
I have had a similar problem myself the last two days, not with Perl but
with a C++ program.

Might be a bit basic, but it is worth checking out the obvious first.

Make sure you have your Apache server set up to run cgi scripts (in
/etc/httpd/conf/httpd.conf).  Seems like you have got this working already
since you can access the script.  I configured my Apache server to:
ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/
AddHandler cgi-script cgi

Also check you print out the following lines to standard out as the first
lines:
Content-type: text/html
<newline>
<newline>

It is imporant to have two newline lines after the Content-type.

Also make sure you do not send anything to standard out before the
"Content-type" line.

What about changing permission on your perl script so the web server can run
it ?  Try "$chmod 777 perlscript.pl".

Do you have a line like "#! /usr/bin/perl" as the first line in your script
so the Web server knows to run the perl interpreter on the script ?

Hope this helps.

Arne



 Wed, 18 Jun 1902 08:00:00 GMT   
 
   [ 4 post ] 

Similar Threads

1. after update of perl, apache cant run perl scripts

2. Cannot run perl scripts in Apache when file opened via Samba

3. problem about running perl script with Apache

4. Running perl scripts locally with apache

5. Problem with running Perl Script with Apache on Linux

6. running perl scripts with apache...?

7. CGI-BIN Perl Script Not Routed Back to Browser using Apache

8. perl script on apache with redhat not working

9. Apache-perl: place html files and perl scripts in the same location

10. Help with running a very simple perl script


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software