Forum Moderators: phranque

Message Too Old, No Replies

IIs + SSI

ssi not working on iis5/win2k advanced server

         

teekid

9:49 pm on May 5, 2002 (gmt 0)



I've got iis 5 running on windows 2000 Advanced Server,
im trying to execute this code :

<!--#include virtual="cgi-bin/show_time.pl" -->

and it doesnt work .. nothing shows up at all , what do i need to do to be able to execute it that way , if i execute it alone , using url/cgi-bin/show_time.pl, it works fine..

JuDDer

10:16 pm on May 5, 2002 (gmt 0)

10+ Year Member



Have you tried using a slash in front of you path?

Example:
<!--#include virtual="/cgi-bin/show_time.pl" -->

Include virtual expects a full path from the root of your site while include file expects a path to the file relative to the document.

Hope this helps.

teekid

10:19 pm on May 5, 2002 (gmt 0)



yeah ive tried just about all combinations i can think of heh ... ive tried renaming the index to many different things , with using includes what should the filename actually be ?

JuDDer

10:20 pm on May 5, 2002 (gmt 0)

10+ Year Member



What is the extension of the page that you're trying to include the file into, ie .asp, .html etc?

teekid

10:30 pm on May 5, 2002 (gmt 0)



ive tried , html , shtml , php , and asp

JuDDer

10:33 pm on May 5, 2002 (gmt 0)

10+ Year Member



OK, first things first - have you tried including any other file formats other than .pl?

I think by default, IIS5 will only include fileB into pageA
if pageA is named .asp or .shtml unless it's specifically setup otherwise.

Try creating a blank page and including another file to see if that works first.

txbakers

11:33 pm on May 5, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm using IIS with W2K AS and have no trouble with includes, but I don't use PL files for including.

All my includes have the extension .inc

Includes don't actually execute - they just bring in code to be used by the browser.

teekid

12:02 am on May 6, 2002 (gmt 0)



ok well how would i go about running a pl to just display on my page ?

Jack_Straw

12:24 am on May 6, 2002 (gmt 0)

10+ Year Member



You don't mention that you created the virtual directory in the internet services management. You have to do that...

If you don't know about virtual directories and such and don't want to do that, you can use ".. file=" instead of ".. virtual=" to access another directory directly. That works fine, if, in your example, cgi-bin is a sub directory of the directory your asp code is in. More likely, though, it is a "sister directory", in which case you can use "... file="../cgi-bin..." in the obvious way, but, to do this, you must enable parent paths through internet services management (in Home Directory >> Configuration >> App Options).

I don't think the issue is the file type. We have included filenames with many different file extensions without any problems.

txbakers

1:04 am on May 6, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ok well how would i go about running a pl to just display on my page ?

You just call it directly as a URL:

[yoursite.com...]

that's all you need.

teekid

2:31 am on May 6, 2002 (gmt 0)



no i mean within my html , inside of my page..

txbakers

3:18 am on May 6, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't think you would run a Perl program inside your HTML. You can put HTML inside your Perl and call the PL program.

But I've never seen a Perl script run inside an HTML page with SSI. But someone might have.

teekid

3:42 am on May 6, 2002 (gmt 0)



ok forget the ssi part , im trying to use show_time.pl in my document , i can show time in php already but i wanna use this perl script.. forget the ssi forget the iis , maybe even move this thread into web development lmao ... all i want to be able to do is use this pl , the readme says to use the include method ...

3. Creating the HTML.
- The following line of code will tell the Web Server to include the output of
the script in the HTML. Assuming that "cgi-bin/show_time.pl" is the correct
path to the script.

<!--#include virtual="cgi-bin/show_time.pl" -->

, now ive got it so far as to it displays the contents of the show time pl , but not execute it and actually proccess the script heh .. so your saying there is no way i can use it ?

txbakers

4:34 am on May 6, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



it displays the contents of the show time pl

I don't know for sure that you can't execute it within your web page, but the "include" statement is working correctly. The purpose of the "include" statement is to bring in code from an external file, which it sounds like it is doing.

If all you want to do is show the time you'd be better off doing it in Javascript or VBscript, both of which can run client side.

JuDDer

9:21 am on May 6, 2002 (gmt 0)

10+ Year Member



Hmm, maybe try changing it from an include to an exec statement, something like this:

<--#exec cgi="/cgi-bin/show_time.pl"-->

On a Unix server that should execute the pl file and the output would be included in your .shtml page but I've never tried it on IIS.

VinceI

1:26 am on May 9, 2002 (gmt 0)

10+ Year Member



I don't know for sure that you can't execute it within your web page, but the "include" statement is working correctly. The purpose of the "include" statement is to bring in code from an external file, which it sounds like it is doing.

If all you want to do is show the time you'd be better off doing it in Javascript or VBscript, both of which can run client side.

Can you run perl scripts by calling them directly and not using the SSI stuff?

If you script is being printed to the screen instead of being executed, then I think that you mean that you don't have your .pl scripts mapped to perl on your system.

Either that or your headers are wrong in the script.

Do you have
print "Content-type: text/html\n\n";
in the script?

teekid

1:39 am on May 9, 2002 (gmt 0)



yeah i have no problem running the perl script alone , using the direct url .... does exactly what its supposed to do ...

VinceI

2:23 am on May 9, 2002 (gmt 0)

10+ Year Member



The only other thing I can think of is that you don't have whatever file extension that has the SSI statement in it mapped correctly.

See this guide [perl.xotechnologies.net ] for detailed instructions on how to do it.

Or, if you have already done that, maybe you need to use code like:
<!-- #EXEC CGI="/cgi-bin/show_time.pl" -->

I think the include statement you are using just 'includes' that information into the file that is calling it, but doesn't execute it.

see the microsoft support page on iis and ssi [support.microsoft.com] for more information.