FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Python script execution help [Serv. 3]





Jaggo
Hello.

I've a brand new account on serv 3, which I intend to use for Python scripting.

However, I can't seem to get the script to run.

I tried putting it on the base public_html dir and access it directly- and recieved a 403.

I followed this tutorial, and after trying to open it I get a
Quote:
500 Internal Server Error:
The server encountered an internal error or misconfiguration and was unable to complete your request


(I even changed the name of the script between .py and .cgi)

What should I do?
Omer.
rvec
did you get the pythontest file working of that tutorial?
Jaggo
rvec wrote:
did you get the pythontest file working of that tutorial?


No, the very first hello world file threw a 500 error.
hummer010
I'm having the same problem on Server 3. Here is my code:

Code:
#!/usr/bin/python
print 'Content-type: text/html\n\n'
print '<html>\n<head><title>Python Test</title></head>\n'
print '<body>\n'
print '<p align="center">Hello World!</p>\n'
print '</body>\n</html>\n'


The output of that is an 500 Internal Server error. Any ideas what's wrong?
Jaggo
Hummer, could you p'raps test something more simple, e.g
Code:

#!/usr/bin/python
print 'Content-type: text/html\n\n'
print 'hellow world'


If that doesn't work try and build it without the shebang line (omit the #!/usr line)

(Jus' to see what happens)
hummer010
Jaggo wrote:
Hummer, could you p'raps test something more simple, e.g
Code:

#!/usr/bin/python
print 'Content-type: text/html\n\n'
print 'hellow world'


If that doesn't work try and build it without the shebang line (omit the #!/usr line)

(Jus' to see what happens)


I tried that with and without the shebang line. Neither worked. I always get the 500 Internal Server Error.
hummer010
Okay, I've made a few more attempts - none successful.

I tried the following code:
Code:
#!/usr/bin/python
print 'Content-type: text/html\n\n'
print 'hellow world'

I tried it as a file named pytest.py and a file named pytest.cgi. Neither worked. I tried removing the shebang line. Neither worked. I made sure that both had the proper permissions set (0755). Still nothing.

Then I tried moving the files out of the cgi-bin directory into the public-html directory. There is no error, but the python doesn't execute. It just displays the contents of the file as text.

I tried doing things mod_python style. I tried the following code:
Code:

def testing():
   print 'Content-type: text/html\n\n'
   print 'hellow world'

and called it by accessing /pytest.py/testing - still the same 500 Internal Server error.

I'm about out of ideas.
Related topics
Python and Serv 3
python script???
What is the difference between CGI and python script?
Anonymous FTP Scanner - Python Script
Script execution problem
website in python
Python, CGI and CSS
python programming
Writing to a file -- Python
Problem with python script
PHP script execution time
Navigation Script (javascript) Help Please!
An Example to mySQL class
Cash Mod Script Need Help!
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.