I have the PHP handler working perfectly fine, but one of my friends would like to use Python as well. I have Python installed on my server at /usr/bin/python2 (for Python2) as well as /usr/bin/python -> /usr/bin/python3 (for Python3). He prefers Python2 so I was just going to have .py files use the Python2 binary. Anyways, after setting it up in the Apache config and suPHP config, it keeps giving me the following error:

SecurityException in Application.cpp:511: Unknown Interpreter: python:/usr/bin/python2
Premature end of script headers: test.py

The relevant lines from httpd.conf:

AddType text/x-python .py
suPHP_AddHandler text/x-python .py

and under the [handlers] section of suphp.conf:

text/x-python="python:/usr/bin/python2"

What do I need to do in order to get Python working via suPHP, if it's possible?

link|improve this question

feedback

1 Answer

up vote 3 down vote accepted

suPHP is specifically designed for PHP; you'll need to use suEXEC, which is part of Apache and simple to use. As long as the python scripts are normally executable as CGIs, it should work fine.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.