Depending on your Apache setup, you may need to try #include virtual= instead of #exec cgi=. This worked on my server, at least.
But I think to use this SSI directive, your file must be *.shtml, or else Apache must recognize it as 'server-parsed' .. Somebody correct me if I'm wrong. | [reply] |
In this case, there could be a few things that would cause that error:
- The script could not be found. Try using the full path to /var/www/cgi-bin/config.pl or wherever. (In apache at least, you can start the path "/" at the document root, or "/cgi-bin/config.pl" in other words.
- The script was found, but did not return a proper header. This, in turn, can be caused by either by the script not compiling, or of course by the script running just fine, but never actually printing a header. Be sure your program prints a CGI->header() or "Content-Type: text/html\n\n" line.
Once you get the script to run, you can pass parameters to it by using the #include virtual style of SSI, like so:
<!--#include virtual="/cgi-bin/somescript.cgi?param1=test¶m2=3" --
+>
blokhead is correct, the server needs to recognize the html file as server-parsed, for which the normal convention is a .shtml extension. Sounds like you're already there though, because the "an error occurred while processing this directive" message embedded in your html page means the server tried to run your script, but couldn't, as stated above.
Hope this helps.
Cheers!
| [reply] [d/l] |
Clarification: When using #include virtual, you can't use the full disk path such as /var/www/cgi-bin. You have to use the second option, a path relative to document root, as in "/cgi-bin/config.pl".
cheers!
| [reply] [d/l] |
Thank you I was looking to this solution for months.
It is worth noting that almost all websites that discuss SSI are wrong or misleading regaurding this.
Even worse many reference books on perl have this wrong!
Thany you very much. | [reply] |