httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "kaustubh shinde" <shindekaust...@hotmail.com>
Subject Re: [users@httpd] cgi error
Date Thu, 04 Mar 2004 18:28:13 GMT

Hi,
Thanx a lot for you reply.
Following is my perl script test.cgi

#!usr/bin/perl

# To use CGI perl module and for using CGI.pm with mod_perl

use CGI;

# parsing all parameters

my $page = new CGI;

print $page->header();

print &htmlsource();

sub htmlsource

{

  return <<EOT



<html>

<head>

<title>Test CGI script</title>

<body>

HELLO WORLD!

</body>

</html>



EOT

}


when i run it from shell with command perl test.cgi, it gives me following 
output
Content-Type: text/html; charset=ISO-8859-1


<html>
<head>
<title>Test CGI script</title>
<body>
HELLO WORLD!
</body>
</html>
which is correct.
But when i run it as ./test.cgi from shell it says
: bad interpreter: No such file or directory

which should mean the first line of the program ( or shebang as you call it) 
is wrong.
But it is correct. I have checked it.
Could you suggest any other source of  error? I am not running suEXEC.
Thanks,
Kaustubh


----Original Message Follows----
From: Marty Landman <MLandman@face2interface.com>
Reply-To: users@httpd.apache.org
To: users@httpd.apache.org
Subject: Re: [users@httpd] cgi error
Date: Wed, 03 Mar 2004 19:08:31 -0500

At 06:06 PM 3/3/2004, kaustubh shinde wrote:

>I have configured my server to execute the files in .../cgi-bin/ directory.
>when i m trying to test the scripts with test.cgi stored in the above 
>directory i get a nessage
>"Premature end of script headers"

That's good in that it seems you have configured the server to run cgi's.

>I have given the a+rwx permissions to the test.cgi file as well as the 
>parent directories.

Your error does indicate that it ran, so permissions appear good.

>I am stuck here and will really really appreciate some help.

Kaustubh, the first thing I'd look at is the script. Could be for instance 
that the shebang (first line) is wrong. Also you could be getting this kind 
of error if you're running suEXEC and something is not right on those 
permissions. How about posting back with the results of attempting to run 
the script from the shell? And checking the suEXEC log if this applies to 
your server would be a good idea as well.

Marty Landman   Face 2 Interface Inc.   845-679-9387
FormATable  DB: http://face2interface.com/Products/FormATable.shtml
Make a Website: http://face2interface.com/Home/Demo.shtml
Free Formmailer: http://face2interface.com/Products/Formal.shtml


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

_________________________________________________________________
Need a job? Get head-hunted by the best. 
http://www.naukri.com/msn/index.php?source=hotmail  Post your CV free!


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message