I think I failed to explain myself fully.
To allow non-PHP pages to call a script that generates a random quote, I have created an invocation script that can be included using Apache's server-side include, e.g.
<!--#include virtual="/scripts/my_script.php?query=something" -->
This allows the function of the script to be used on SHTML pages without converting the page to PHP. Apache executes the desired script and embeds the result of it, not the code from it, into the SHTML document. The script need never be accessible to the public.
So I'm afraid that neither of the above suggestions work.
I'm starting to think that it's simply not feasible to use this SSI include option. I may have to bite the bullet and simply convert all of the script-client pages to PHP.
I am surprised, though, that Apache doesn't seem to offer a way of hiding these included scripts from the outside world without making it invisible to Apache and PHP also.