+ Reply to Thread
Results 1 to 4 of 4

Thread: Python

  1. #1
    insomniaweek is offline x10Hosting Member insomniaweek is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    1

    Python

    Please help, I've spent nearly an hour trying to get python cgi scripts to work. Can someone please explain how I do this?
    I put test.cgi in my cgi-bin folder with
    Code:
    #!/usr/bin/python
    
    
    
    print "Content-Type: text/plain\n\n"
    
    
    
    import sys
    
    print sys.version
    
    print sys.modules
    in it and saved it. However, when I open it, I get a 500 server error. Please help.

    I've tried :
    -Changing the code to /user/local/bin/python, /user/local/bin/env python, /user/bin/env python
    -Putting it in /scgi-bin
    -Changing the main code to a dozen simple varients
    -Saving as test.py and making the apache handler cgi-script for .py files

  2. #2
    lch-x10hosting is offline x10Hosting Member lch-x10hosting is an unknown quantity at this point
    Join Date
    May 2008
    Posts
    8

    Re: Python

    Quote Originally Posted by insomniaweek View Post
    -Saving as test.py and making the apache handler cgi-script for .py files
    I have signed up mainly for this, too. But you're at least further than I am with installing the apache handler, like everybody is referring to. I get: "Your admin has not created a cPAddons configuration yet. Please contact them and ask them to do so."

    So, is there some HowTo how one can get Python here?

  3. #3
    Starshine's Avatar
    Starshine is offline Legend Killer Starshine is an unknown quantity at this point
    Join Date
    Jul 2006
    Location
    U.S.A.
    Posts
    7,211

    Re: Python

    Quote Originally Posted by lch-x10hosting View Post
    I have signed up mainly for this, too. But you're at least further than I am with installing the apache handler, like everybody is referring to. I get: "Your admin has not created a cPAddons configuration yet. Please contact them and ask them to do so."

    So, is there some HowTo how one can get Python here?
    Are you trying to click on "Site Software" when you get that error? Site Software is being discontinued by Cpanel and has nothing to do with Python or using Python. If you are looking for software to install, please use Fantastico. ( And if you were aware of the other messages, you would of known the answer to this )

  4. #4
    lch-x10hosting is offline x10Hosting Member lch-x10hosting is an unknown quantity at this point
    Join Date
    May 2008
    Posts
    8

    Re: Python

    Quote Originally Posted by Starshine View Post
    Are you trying to click on "Site Software" when you get that error?
    Yes. I figured that would be where one could setup those things. The only other thing that comes close is the MIME Types module, but that's only to specify mime types, not handlers.
    Quote Originally Posted by Starshine View Post
    Site Software is being discontinued by Cpanel and has nothing to do with Python or using Python.
    Where can I configure things regarding the Apache server like this handler for .py files, then? I'd be grateful if you could point me to some documentation how it is done.
    Quote Originally Posted by Starshine View Post
    If you are looking for software to install, please use Fantastico. ( And if you were aware of the other messages, you would of known the answer to this )
    No, I don't want to install software, I want to be able to use custom Python scripts. (and I read the other messages and all they tell is "configure the apache handler")

    Edit:
    Okay, nevermind. I got this working myself now. I added the following to my .htaccess to have python scripts working outside of cgi-bin:
    Code:
    Options +ExecCGI
    AddHandler cgi-script .py
    Then I tested with the explore.py script from http://moinmo.in/HelpOnInstalling/ApacheOnLinuxFtp and it worked. However, if a script uses a module which is not installed then you get a 500 error and NO INFO at all in your Error log.

    Also, I found that FTP is the only reliable method for working on the server. The WebDAV thing is broken for almost all things except viewing directories, chmod and overwriting files. The upload script tends to fail for some things, too.

    I saw a post by somebody earlier who had a list of all the modules available to Python here, I'll try to find it again. More official info on this wouldn't hurt, though.
    Last edited by lch-x10hosting; 05-05-2008 at 07:45 PM. Reason: Automerged Doublepost

+ Reply to Thread

Similar Threads

  1. Python MySQLdb busted still or again
    By gniouf in forum Scripts & 3rd Party Apps
    Replies: 13
    Last Post: 07-31-2008, 06:00 PM
  2. Python / MySQLdb
    By Korexio in forum Free Hosting
    Replies: 9
    Last Post: 11-29-2007, 08:29 AM
  3. Python/.htaccess help
    By *Face in forum Free Hosting
    Replies: 6
    Last Post: 09-21-2007, 01:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers