LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-24-2005, 12:01 PM   #1
SkipHuffman
Member
 
Registered: Mar 2005
Posts: 81

Rep: Reputation: 15
SSI works from #exec, but not from #include.


This page:

Code:
<html>
        <head>
                <title>Hit Me</title>
        </head>
        <body>
                <h2>Test Page</h2>
                <ol>
                        <li><!--#include virtual="something.html"-->
                        <li><!--#include virtual="../cgi-bin/Hello.pl"-->
                        <li><!--#exec        cmd="../cgi-bin/Hello.pl" -->
                        <li><!--#include virtual="something_else.html"-->
                </ol>
                <p> end testing
        </body>
</html>
This cgi:
Code:
#!/usr/bin/perl -wT

print "<H2>Hello</h2>";
This result:
Code:
Test Page

   1.      something
   2. [an error occurred while processing this directive]
   3.      Hello
   4.      something else 

end testing
Why does the script fail on item 2 but succed on item 3?

Thanks
 
Old 08-24-2005, 09:32 PM   #2
Rotwang
Member
 
Registered: Jan 2004
Distribution: CentOS
Posts: 281

Rep: Reputation: 30

oops nevermind, I misread your question. I think the reason it's not working is that executables need to be in an exec. Includes just paste the file in- don't execute anything.

Last edited by Rotwang; 08-24-2005 at 09:35 PM.
 
Old 08-24-2005, 10:15 PM   #3
SkipHuffman
Member
 
Registered: Mar 2005
Posts: 81

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by Rotwang
oops nevermind, I misread your question. I think the reason it's not working is that executables need to be in an exec. Includes just paste the file in- don't execute anything.
So the book that I am reading "Writing CGI Applications with Perl" http://tinyurl.com/chfxu is just plain wrong? I have found a couple of minor errors, but that is a huge one.

Also the Apache documentation http://httpd.apache.org/docs/2.0/howto/ssi.html says that I should be able to do it:

Quote:
Including the results of a CGI program

This is one of the more common uses of SSI - to output the results of a CGI program, such as everybody's favorite, a ``hit counter.''

<!--#include virtual="/cgi-bin/counter.pl" -->
I think I am just missing some sort of permissions.
 
Old 08-25-2005, 02:22 AM   #4
Rotwang
Member
 
Registered: Jan 2004
Distribution: CentOS
Posts: 281

Rep: Reputation: 30
Oh wow, I'm wrong then. Hmm.. I wonder what's the point of the exec directive... If include can do the same thing...

To change perms you probably just need:

chmod +x Hello.pl

Hmm but maybe there's a setting in apache to permit executable #includes as well.
 
Old 08-25-2005, 07:16 AM   #5
SkipHuffman
Member
 
Registered: Mar 2005
Posts: 81

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by Rotwang
Oh wow, I'm wrong then. Hmm.. I wonder what's the point of the exec directive... If include can do the same thing...
I think, but I may be wrong, that "#exec" is intended as sort of a generic. The output of any command can be dumped to the document. I think "#include" is expecting more formatted data.

Quote:
To change perms you probably just need:

chmod +x Hello.pl
Don't teach your granny to suck eggs, son. ;-)

I meant something in .htaccess or httpd.conf
Quote:
Hmm but maybe there's a setting in apache to permit executable #includes as well.
Yeah, that is my thinking.

Thanks anyway.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CGI works from SSI exec, but not from include. SkipHuffman Linux - Software 2 08-25-2005 10:15 PM
Include ssi in a form? @ngelot Programming 4 05-11-2005 07:39 AM
SSI include line from text-file? @ngelot Programming 4 05-11-2005 06:43 AM
SSI is not working... help! dbeatle123 Linux - General 20 03-23-2005 02:23 PM
ssi problem dsgdevil Linux - General 1 02-15-2003 05:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration