Heya folks.
Firstly, I'm not a python guy. I code in PHP / Asp .net.
I'm trying to get a test script running on my site.
In SSH, I type ">> python" and I see python is installed (2.66).
I created a test.py file in the root folder of my website with the following code:
#!/usr/bin/python
print "hello"
The file has 755 permissions.
It is written using US ASCII encoding.
But it does not execute. And the code is displayed in plaintext in the browser.
Some observations:
/usr/bin/python does not exist when I look for it in SSH. Should it? (I'm using this path in the script because of this help topic: https://www.godaddy.com/help/what-is-the-path-to-python-on-my-hosting-account-644 )
/usr/lib/python2.6 does exist. I don't know the significance of it.
Any ideas?
Thanks in advance.
Rick
Solved! Go to Solution.
I'm not a Python guy myself, but you probably have to add a handler for .py files to your .htaccess. Try this:
Options +ExecCGI AddHandler cgi-script .py
OK, so I found the error log in cPanel, and I need to chase down the errors now (new territory for me). But python is indeed executing. So, thanks again, BenWTF. Problem solved.
Best,
RD
I'm not a Python guy myself, but you probably have to add a handler for .py files to your .htaccess. Try this:
Options +ExecCGI AddHandler cgi-script .py
OK, so I found the error log in cPanel, and I need to chase down the errors now (new territory for me). But python is indeed executing. So, thanks again, BenWTF. Problem solved.
Best,
RD