Question

If I want to insert the output of a script into an HTML file using server side includes, is it better to use

<!--#include virtual="/cgi-bin/myscript.py" -->

or

<!--#exec cmd="python /cgi-bin/myscript.py" -->

?

Was it helpful?

Solution

A small advantage to the #include format is that, should you change the location or name of your python executable, you only need to change the configuration once in your Apache config, rather than having to change every SSI call on your site.

Both of these forms, however, will start up and tear down a new python binary every time the script is called, which is a decently big hit. This is why something like mod_python is almost always preferred.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top