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" -->
?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.