Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error message code=87

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi, guys!
I'm trying to execute script with .cgi extension and keep getting this error message:
Failed to execute script: Win32 error code = 87.
Could anyone tell me what are possible reasons that cause this error.
I just started with CGI and this .cgi script is just a try to get well-known output "Hello" on a web page.
I'm running Win2K Advanced Server w/IIS 5.0, I have Perl installed, I added MIME type application/x-httpd-cgi , directory, which my files are in has Script and Execute Permissions. Here are the files, which I cannot execute:

hello1.shtm
---------------------
<HTML>
<HEAD>
<META NAME=&quot;GENERATOR&quot; Content=&quot;Microsoft Visual Studio 6.0&quot;>
<TITLE></TITLE>

</HEAD>
<BODY>

<P> </P>
<!-- #exec cgi=&quot;scripts/hello1.cgi&quot;-->
</BODY>
</HTML>

Hello1.cgi
-----------------------
#! d:/perl/bin/perl
print &quot;Content-type: text/html \n\n&quot;;
print &quot;Hello, anybody!&quot;

If I save hello1.shtm just as .htm file, it doesn't give any output. If I try to execute .cgi file directly - not calling it from another file - I get an &quot;Internal Server Error&quot;.

Maybe I just coded it wrong, if one could call that 'coding'? So, any help on this will be highly appreciated.

Thank you.


 
[red]#! d:/perl/bin/perl[/red]
If that line in you post is the same as that line in your code, then the space after the ! is a killer.

[red]print &quot;Hello, anybody!&quot;[/red]
That line is missing a semicolon at the end.

Otherwise, you should be able to save the snippet into your cgi-bin dir and hit it directly via a browser to get &quot;Hello, anybody!&quot; back.


keep the rudder amid ship and beware the odd typo
 
Hi, goBoating!
Thank you for response.
It doesn't seem that a space or missing semi-colon is a problem here.
See, when I'm executing the same snippet of code(as in hello1.cgi), but saved as .pl - everything is OK. But as soon as I try to use SSI command in hello1.shtm -
[red]<!-- #exec cgi=&quot;scripts/hello1.cgi&quot;-->[/red],-
I get the error 87 right away.
So, I think there's something wrong with SSI or .shtm stuff, or my server configuration. I just don't know what.
And what this &quot;error 87&quot; stands for? And one more thing. Does it have to be in cgi-bin directory?
If you have any ideas what else might be wrong or could address me to some source on using CGI with Windows and IIS, I'd really appreciate this.
Thank you.
 
I'm not familiar with how IIS restricts the use of SSIs. Apache can be setup to prevent exactly what you are trying to do.... so I wonder is your IIS setup similarly preventing the desired behavior. Sorry, I'm not much help with the MicroSoft Web Server.

I expect the ' error 87' is being generated by IIS because you are trying to do something it does not want to do. As above, I'm not up to speed on the IIS stuff so I don't know what that specific code means. Try checking the IIS documentation.

Finally, I expect that you will need to put any code that you want your web server to execute in a cgi-bin directory( or equivalent - Apache has a 'ScriptAlias' parameter that will let you add directories as legal for executable code. IIS probably has the same capability). Again, on IIS I don't know how that is specified/controlled.

Sorry, I can't be more specific. Maybe some other members can speak more to the specifics.

HTH


keep the rudder amid ship and beware the odd typo
 
goBoating,
thnx you anyway for your time and suggestions. I'll keep looking for the solution.
Have a great day.
 
Try this:

Make two files, and name them both .shtml.

i.e.
[tt]
name this index.shtml
<html>
<head>
<title>test</title>
</head>
<body>
<!--#include file=&quot;other.shtml&quot;-->
</body>
</html>

and in other.shtml

<table border=0>
<tr>
<td> test</td>
</tr>
</table>

[/tt]

Try to run that. If you generate the same error, then that tells you something is wrong with the SSI part of your server set up. If it works fine, then you know it is either the .CGI or something else.

Another thing you might want to try is to take the spaces out of the include:

From...
<!-- #exec cgi=&quot;scripts/hello1.cgi&quot;-->
To..
<!--#exec cgi=&quot;scripts/hello1.cgi&quot;-->

Try that and if that does not work, then I suggest you take goBoating's approach and read the manual.

Hope this helps,

-Vic vic cherubini
vikter@epicsoftware.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director
====
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top