SSI Problem

I am trying to call SSI from an html document (I've tried .html, .htm, .shtml, .shtm). I keep getting the following error "[an error occurred while processing this directive]" I have looked at my .htaccess file and I think it's set up correctly. I can run non-ssi scripts fine, but #exec and #include SSI calls don't work. Other SSI calls work fine, except those two. I'm not too experienced with SSI so I am seeking an answer desperately. I've been to "" for more info and have tried everything I could find. I still get errors. Any help?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

talynAuthor Commented:
Edited text of question
talynAuthor Commented:
Edited text of question
This error occurs 95% of the time due to a permissions problem. Make sure the user running httpd owns the script and that the script that the html document calls is executable,


OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

talynAuthor Commented:
The permissions of the scripts are set correctly as are all the paths within the scripts themselves. I can run the admin.cgi script to set stuff up since it's called directly, but once I try to call a script named:  amslite_ssi.cgi by the following method:

<!--#exec cgi="cgi-bin/ams/amslite_ssi.cgi"-->


<!--#include virtual="cgi-bin/ams/amslite_ssi.cgi"-->

it gives me an error.

I have my own virtual domain with full access and executable rights set. I'm thinking it's a .htaccess configuration problem or lack of configuration?

Do I need to set 'Options' or a <Limit> identifier?

Are you positive that your server support SSI?

"cgi-bin/..." means that cgi-bin is a directory under your page's directory.

Maybe you mean "/cgi-bin/...", which means cgi-bin under the web server root.
talynAuthor Commented:
Adjusted points to 175
Have you added:
AddType text/htmlk .shtml
AddHandler server-parsed .html

to srm.conf?
Is this your own server? Are you using Apache? If this is not your server, are all SSI functions made available to you? Have you tried the complete SERVER path to the file? ie /home/username/cgi-bin/filename (or whatever)

John Ray - jraywco -

talynAuthor Commented:
fln has the right answer. For some reason I had to separate the line in the .htaccess file.

I had AddType text/html server-parsed html .shtml which is what I found when going through some documentation.

When I separated the lines as fln pointed out, it worked? The server is an Apache running Linux.

fln if you wish to post that as an answer I will award the points to you.

These two includes were in a posted comment, so I am assuming that these are the items in question.
<!--#exec cgi="cgi-bin/ams/amslite_ssi.cgi"-->
<!--#include virtual="cgi-bin/ams/amslite_ssi.cgi"-->

Permissions you said are correct but the first problem would be finding the script in the first place.  If you use virtual you have to give an absolute path name AND it cannot be an executable/script.  The include SSI will only allow text/html files to be included.  As for the exec, this should be an absolute path as well.

So to get these two to work.  First copy amslite_ssi.cgi to amslite_ssi.txt into some directory that your web browser has read access, so that the virtual statement will work.  Then try
<!--#include virtual="/~home/ams/amslite_ssi.txt"-->

For the exec try
<!--#exec cgi="/cgi-bin/ams/amslite_ssi.cgi"-->

This assumes that the amslite_ssi.cgi is in the web servers cgi-bin directory.  If it is not and the cgi-bin directory is really a local directory that you have read acces to, then try these: (you still need copy the file for the plain include to work)
<!--#exec cgi="./cgi-bin/ams/amslite_ssi.cgi"-->
<!--#include file="cgi-bin/ams/amslite_ssi.txt"-->
First off, .htaccess has nothing to do with SSI - that is for password protected directories.

Anyways it sounds like the problem you are having is that the script you are trying to run doesnt have the right permissions set on it. You need to execute a CHMOD 777 on the file you are trying to #exec.  this should solve the problem.
In case you arent familiar with CHMOD, there are two ways you can do it
the first is to telnet in if you have a shell account and type
CHMOD 777 <filename>
Or, use Cute FTP ( available at ). open up your FTP account ,select the file you are trying to #exec, right click, select CHANGE FILE attributes, and in the box type 777 and OK...this should solve your problem
talynAuthor Commented:
Sorry for the confusion, I had to create a global ACF in order to get the correct type and permissions for the directory I was working with. In this case I had a directory within the cgi-bin where the permissions where set wrong. When I mentioned .htaccess, I was mistaken. I made the changes within access.conf.

On my server you cannot chmod any executables to 777 since this may create a security problem. They must be chmod 755.
ok an answer

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.