Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

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:


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

share|improve this question
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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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