Go Back   HostGator Peer Support Forums > HostGator Peer Support Forums > Shared Hosting Support

Notices

Reply
 
Thread Tools
  #1  
Old 06-30-2007, 06:53 AM
Meridian66 Meridian66 is offline
Hatchling Croc
 
Join Date: Jun 2007
Posts: 3
Default Running a python script just gives me the txt of the script

I was just trying to run a python script from scgi-bin, and all I get is the text of the script echoed back on the screen, as if it was a plain text file. I changed exec permisisons, and activated scgi-n.

I copied this from another post here:
#!/usr/bin/python

import os, sys
from cgi import escape

print "Content-type: text/html"
print
print "<pre>"
print "<strong>Python %s</strong>" % sys.version
keys = os.environ.keys()
keys.sort()
for k in keys:
print "%s\t%s" % (escape(k), escape(os.environ[k]))
print "</pre>"
Any idea what I could be doing wrong?
thanx
Reply With Quote
  #2  
Old 06-30-2007, 11:52 AM
esl's Avatar
esl esl is offline
Emperor Croc
 
Join Date: Jan 2005
Location: Proud to be an American - USA
Posts: 2,232
Default Re: Running a python script just gives me the txt of the script

HostGator may be able to assist you with this. I would recommend opening a trouble ticket.
__________________
Have a great day,
Evan
Reply With Quote
  #3  
Old 06-30-2007, 06:27 PM
Meridian66 Meridian66 is offline
Hatchling Croc
 
Join Date: Jun 2007
Posts: 3
Default Re: Running a python script just gives me the txt of the script

Thanks Evan, I opened a ticket and got a near instantaneous reply (good response times!).

The answer is: "Unfortunately, Python is not supported via Apache. This is only supported from the command line shell."

Ah well, no python scgi-bin access for me it seems. Off to find another hosting service now.

edit: not that I'm complaining -- support here is great -- just that I need a basic hosting package with the ability to run some python scripts (very low usage, so a dedicated server is overkill).

Last edited by Meridian66; 06-30-2007 at 06:35 PM.
Reply With Quote
  #4  
Old 07-16-2007, 06:26 AM
Meridian66 Meridian66 is offline
Hatchling Croc
 
Join Date: Jun 2007
Posts: 3
Default Re: Running a python script just gives me the txt of the script

Update for anyone reading this. Unfortunately I had to move to another hosting company after a couple of good years with HostGator. However, given the rising popularity of Python for web frameworks, I expect HostGator will begin to support it at some point, at which point I will be back
Reply With Quote
  #5  
Old 07-16-2007, 09:26 AM
kmaw's Avatar
kmaw kmaw is offline
Emperor Croc
 
Join Date: Mar 2005
Location: Ontario, Canada
Posts: 1,924
Default Re: Running a python script just gives me the txt of the script

I thought HG supported Python??? It says so on the hosting features pages.... ?
Reply With Quote
  #6  
Old 07-16-2007, 09:29 AM
Sam Sam is offline
Emperor Croc
 
Join Date: Jan 2007
Location: /bin/false
Posts: 3,057
Default Re: Running a python script just gives me the txt of the script

Quote:
Originally Posted by kmaw View Post
I thought HG supported Python??? It says so on the hosting features pages.... ?
Yep http://www.hostgator.com/popup/python.html
Reply With Quote
  #7  
Old 07-16-2007, 11:12 AM
smp's Avatar
smp smp is offline
Swamp Croc
 
Join Date: Mar 2007
Posts: 318
Default Re: Running a python script just gives me the txt of the script

Quote:
Originally Posted by _Sam_ View Post
i'm just as confused as you guys, anyway I've submitted a ticket, as i'll have to remove it from my own features list if they don't support it.

I'll update when I recieve a responce.

Regards, Steve Xx
__________________
The future is dark, the future is red!
The Future is Smp

Reply With Quote
  #8  
Old 07-16-2007, 11:28 AM
kmaw's Avatar
kmaw kmaw is offline
Emperor Croc
 
Join Date: Mar 2005
Location: Ontario, Canada
Posts: 1,924
Default Re: Running a python script just gives me the txt of the script

Kyle: hello, do you support python?
Jess: Yes
Kyle: OK, thanks
Jess: You're welcome!
Reply With Quote
  #9  
Old 07-16-2007, 11:38 AM
smp's Avatar
smp smp is offline
Swamp Croc
 
Join Date: Mar 2007
Posts: 318
Default Re: Running a python script just gives me the txt of the script

Quote:
Originally Posted by kmaw View Post
Kyle: hello, do you support python?
Jess: Yes
Kyle: OK, thanks
Jess: You're welcome!
lol - I suppose I could have asked LH, but wanted a more precise answer.

Anyway the answer:

Quote:
We offer python from the command line shell as well as through CGI, however we dont offer it through mod_python or fastcgi
Regards, Steve Xx
__________________
The future is dark, the future is red!
The Future is Smp

Reply With Quote
  #10  
Old 07-16-2007, 11:44 AM
kmaw's Avatar
kmaw kmaw is offline
Emperor Croc
 
Join Date: Mar 2005
Location: Ontario, Canada
Posts: 1,924
Default Re: Running a python script just gives me the txt of the script

Yes, but yours is more specific -- and more useful.
Reply With Quote
  #11  
Old 07-16-2007, 11:46 AM
Sam Sam is offline
Emperor Croc
 
Join Date: Jan 2007
Location: /bin/false
Posts: 3,057
Default Re: Running a python script just gives me the txt of the script

I got:

Please wait for a HostGator operator to respond.
Welcome to HostGator Live Chat! You are now chatting with 'ChrisD'
ChrisD: Welcome to HostGator, how may I assist you?
Sam: hi, do you support python?
ChrisD: Yes we do.
Sam: Is that via the command line or Apache?
There may be a problem communicating with ChrisD. Please wait while your chat is transferred to another operator.
Welcome to HostGator Live Chat! You are now chatting with 'ChrisD'

Then it broke lol
Reply With Quote
  #12  
Old 07-16-2007, 08:54 PM
Break the Silence's Avatar
Break the Silence Break the Silence is offline
Junior Croc
 
Join Date: May 2007
Posts: 154
Default Re: Running a python script just gives me the txt of the script

Quote:
Originally Posted by _Sam_ View Post
There may be a problem communicating with ChrisD. Please wait while your chat is transferred to another operator.
Welcome to HostGator Live Chat! You are now chatting with 'ChrisD'
Wow...

Two ChrisD's working for the same company at the same time on the same shift. What are the odds of that?
Reply With Quote
  #13  
Old 07-16-2007, 08:56 PM
Sam Sam is offline
Emperor Croc
 
Join Date: Jan 2007
Location: /bin/false
Posts: 3,057
Default Re: Running a python script just gives me the txt of the script

Quote:
Originally Posted by Break the Silence View Post
Wow...

Two ChrisD's working for the same company at the same time on the same shift. What are the odds of that?
Yea
Reply With Quote
  #14  
Old 07-16-2007, 09:03 PM
GatorDaveC's Avatar
GatorDaveC GatorDaveC is offline
HostGator Staff
 
Join Date: Mar 2006
Location: Ontario, Canada
Posts: 937
Default Re: Running a python script just gives me the txt of the script

We do support Python on all of our servers. I'm not sure who told you this incorrect information, but I would like to find out. Is there a ticket number regarding this at all? Do you recall the name of the person?

AddHandler cgi-script .py

Should allow you to run Python scripts without any problems.
Reply With Quote
  #15  
Old 07-16-2007, 09:05 PM
kmaw's Avatar
kmaw kmaw is offline
Emperor Croc
 
Join Date: Mar 2005
Location: Ontario, Canada
Posts: 1,924
Default Re: Running a python script just gives me the txt of the script

Quote:
Originally Posted by GatorDaveC View Post
We do support Python on all of our servers. I'm not sure who told you this incorrect information, but I would like to find out. Is there a ticket number regarding this at all? Do you recall the name of the person?
See my livechat above...
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 01:25 AM.