Help. Cannot include .cgi files in my shtml :(

Help. Cannot include .cgi files in my shtml :(

Posted by: Incredible
Posted on: 2006-06-19 21:02:00

I am trying to include an html where I put in a .cgi file outputed unto my main index.shtml. I have no idea on how to do this. I have tried creating .htaccess and put it together in my index.shtml but still have no luck. The page keep displaying the following message error: [an error occurred while processing this directive].

Please help. I have this in my .htaccess file:

Options Includes
AddType text/html shtml
AddHandler server-parsed shtml

This is inside my .cgi file:

#!/usr/local/bin/perl

use strict;
use CGI qw(:standard);

print header;
print h3('Random quotes');
print p('Hello World.');
Edited by Incredible on 06/19/06 09:55 PM (server time).

Re: Help. Cannot include .cgi files in my shtml :(

Posted by: guice
Posted on: 2006-06-20 08:35:00

Can you got the file yourself? Ie, can you bring it up properly in the browser?

If that works, then it's an error with your include statement within the file. SSIs are getting parsed, so your .htaccess is correct. You can cross that off your list.

Re: Help. Cannot include .cgi files in my shtml :(

Posted by: Incredible
Posted on: 2006-06-20 22:17:00

when I run the .cgi by itself, it run like its suppose to. When I use the include, it is showing this error:

Generate using /cgi-bin/helloworld.cgi - > [an error occurred while processing this directive]
Generate using echo DATE_LOCAL - > Tuesday, 20-Jun-2006 22:16:15 PDT

Re: Help. Cannot include .cgi files in my shtml :(

Posted by: guice
Posted on: 2006-06-21 05:17:00

What do you mean by running it by itself? It's very important that it runs if you access it via the browser: http://domain.com/cgi-bin/helloworld.cgi

What does your SSI directive look like?

As I said before, the SSI is parsing. It can ONLY be One of two problems:
- Script isn't running
- SSI directive is incorrect

That's it. Those are the only two possible problems.

Re: Help. Cannot include .cgi files in my shtml :(

Posted by: periwinkle
Posted on: 2006-06-21 13:47:00

Are you using include virtual or include file to run the SSI directive? You probably need to use include virtual.

Re: Help. Cannot include .cgi files in my shtml :(

Posted by: Incredible
Posted on: 2006-06-22 23:40:00

Yes what I meant when running itself is by going to http://domain.com/cgi-bin/helloworld.cgi. It runs like it suppose to.

The code that did not work was:

Generate using /cgi-bin/helloworld.cgi - > <! --#include cgi="/cgi-bin/helloworld.cgi" -->


The code that works (have to use virtual like periwinkle said)

Generate using /cgi-bin/helloworld.cgi - > <! --#include virtual="/cgi-bin/helloworld.cgi" -->

Edited by Incredible on 06/22/06 11:47 PM (server time).

Re: Help. Cannot include .cgi files in my shtml :(

Posted by: periwinkle
Posted on: 2006-06-23 05:34:00

awesome - glad to have helped.

Tags: shtmlcgi fileshtaccess filetext htmlmain indexhello worldhelpmessage errorparsedusrperlluck