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

Re: [LI] the shell , cgi & other scripts are not running directly on prompt.



Naveen Sharma proclaimed:
> I have instaslled Red hat linux 6.1,Apache 1.3 , perl5 on my pc.
> But on my pc the shell , cgi  & other scripts are not running directly on
> prompt.
> 
> Pls. solve the problem if u know whats wrong with my pc.
> 
> SEE some commands -
> 
> $>pwd
> /home/httpd/cgi-bin
> 
> $>whereis perl
> perl: /usr/bin/perl5.00503 /usr/bin/perl /usr/man/man1/perl.1
> 
> $>cat test.cgi
> #!/usr/bin/perl
> print "HELLO THIS  IS TEST SCRIPT !";
> 

A CGI script should send out a proper contet-type MIME header.  Change this
script to:

#!/usr/bin/perl
print "Content-type: text/html\n\n";

print "Hello world\n";


> (user: root)
> 
> $>chmod 777 test.cgi            (and also with test.pl both have same
> contents )
> 
> $>test.cgi    (and also with test.pl both have same contents )
> bash: test.cgi:command not found


Try 

$> ./test.cgi

Thaths
-- 
Marge: Looks like you were saved by a Christmas tree.
Homer: And somebody wanted to get rid of it in April!
Sudhakar C13n http://people.netscape.com/thaths/ Lead Indentured Slave
--------------------------------------------------------------------
The Linux India Mailing List Archives are now available.  Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.