[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Perl CGI script



Hi,

Someone was having a problem with this perl script. After looking through the
errors, I would like to make a few suggestions:

1. The path to perl might be wrong. Do a 

which perl

and try putting the correct path here.

2. The #!/usr/bin/perl line should be the first line in the script. Check if
it is so.

3. httpd runs usually as nobody.nobody. Check if you are a member of group
nobody. If you are, give r-x permissions to group. If you are not, then give
r-x permissions to others.

4. You should also output the correct HTML tags. A

print "<html><head></head><body>\n";

after the Content-type line should work.

5. Check if you are allowed to run CGI scripts. Look into
/etc/httpd/conf/access.conf, and look for lines that looks like

<Directory /path/to/your/dir>
Options ExecCGI
</Directory>

In your case, I feel the reason is one of 1, 2 or 3.

Regards,

Binand

#########################Begin Script####################
#!/usr/bin/perl

print "Content-type: text/html\n\n";
print "<H3>Hello World</H3>\n";
#########################End Script####################

> >   ---------------------------------------------------------------------------
> > [Tue Jul 20 17:07:14 1999] [error] (2)No such file or directory:
exec of /home/devand/public_html/cgi-bin/missing_handler.cgi failed 
> > [Tue Jul 20 17:07:14 1999] [error] [client 127.0.0.1] Premature end of
script headers: /home/devand/public_html/cgi-bin/missing_handler.cgi

- -- 
main(int c,char **v){while(!fork()){strcpy(v[0],tmpnam(0));sleep(1);}}
A program that changes its name and pid every second.
Try this program at your own risk!   ---> Binand <---


- --------------------------------------------------------------------
For more information on Linux in India visit http://www.linux-india.org/
The Linux India mailing list does not accept postings in HTML format.

------------------------------