How to check if Python script engine is enabled and working for a domain

Refers to:

  • Plesk 11.5 for Linux
  • Plesk 12.0 for Windows
  • Plesk 12.0 for Linux

Created:

2016-11-16 13:08:24 UTC

Modified:

2017-01-29 23:07:05 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to check if Python script engine is enabled and working for a domain

Symptoms

How to check if Python script engine is enabled and working for a domain?

Resolution

There are 2 ways to check if Python scripting engine is enabled for a domain:

  1. Using the default Plesk domain page content (http://domain.tld/index.html) - then by the "Python" item. The domain name should be resolved locally at least and the web-content should be Panel domain default content.

The test looks successful if a page with a list of environment variables is shown.

  1. Using a simple script like this:

    #!/usr/bin/env python
    # -*- coding: UTF-8 -*-

    # enable debugging
    import cgitb
    cgitb.enable()

    print "Content-Type: text/plain;charset=utf-8"
    print

    print "Hello World!"

    It is necessary to put the content into a text file and save in the domain web-accessible folder (like $HTTPD_VHOSTS_D/domain.tld/httpdocs ) on the server with .py extension (test.py for example). Then try to open the file via browser by the http://domain.tld/test.py URL. The domain name should be resolved locally at least.

    The test looks successful if a page shows the "Hello World!" string. If an error or full script listing is visible, it means that Python engine is not configured for the domain properly.

    Note : To enable Python scripting engine go to Tools & Settings > Apache Web Server > check python .

Have more questions? Submit a request
Please sign in to leave a comment.