The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to install Python in my cPanel Webhosting?

Discussion in 'General Discussion' started by AlgorithmRox, Nov 23, 2010.

  1. AlgorithmRox

    AlgorithmRox Registered

    Joined:
    Nov 23, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hello
    I have recently bought a reseller plan of webhosting with Cpanel installed.
    But the problem is i want to run a thing which requires Python to run,and I am a beginner to Cpanel tool and don't know how to install Python in my hosting.
    Please,I will be glad if you people can help me step by step to install Python as I am a newbie.

    I will be waiting for response Thanks.
     
  2. AlgorithmRox

    AlgorithmRox Registered

    Joined:
    Nov 23, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Anyone?????????
     
  3. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Python is normally already installed on a cPanel server, because Mailman and yum (the CentOS/Red Hat update system) require it. Since Python is likely already installed, then a handler needs to be created for Python, and that is not created by default. The handler tells Apache to pass Python scripts to the Python interpreter to be executed, instead of sending the script to the browser for download.

    You can define a Python handler in cPanel. To do this, click Apache Handlers on the main cPanel page for the account that needs to run a Python script. Enter cgi-script in the box next to Handler, and enter .cgi .pl .py in the box next to Extension(s). Click Add. The handler will be added and listed as a user-defined handler.

    Now, change the permissions on any Python script files to 755 if you have not done so already. The files will need 755 permissions in order for suexec to execute them. The Python script files should now be executed if you call them from a browser.

    I tested the above procedure on one of my servers, and it worked well. There is more information about this available in our forums. I found the following thread that might be helpful:

    http://forums.cpanel.net/f5/i-am-willing-pay-help-installing-python-8689.html

    The following section of our documentation explains how to add Apache handlers in cPanel:

    Apache Handlers
     
  4. AlgorithmRox

    AlgorithmRox Registered

    Joined:
    Nov 23, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Ok i will try it and tell.
     
  5. AlgorithmRox

    AlgorithmRox Registered

    Joined:
    Nov 23, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hello,
    I added the Apache Handlers but the problem still is there bro.
    I am using a Torrent PHP client on my hosting.
    And in its settings it says that PYTHON Path is not found.
    "Python Path
    Specify the path to the Python binary (usually /usr/bin/python or /usr/local/bin/python): Not Found"

    Please help me regarding it.
     
  6. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    You will need to contact your host for further assistance with this. Ask them for the path to the Python binary file. Specifically, ask them for the output of this command:

    Code:
    # which python
     
Loading...

Share This Page