The calling page containing the form submitting the request to a python script in cgi-bin works on my personal server. It fails when I load it up on x10hosting. Obviously, it is not set up properly. How to do that?
The calling page containing the form submitting the request to a python script in cgi-bin works on my personal server. It fails when I load it up on x10hosting. Obviously, it is not set up properly. How to do that?
Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.Misson, not Mission.
I did search and came up with nothing.
Please suggest how to reach one of those threads.
So much for the helpful members of this forum.
1. Make sure the script has permissions set to 0755
2. Script should have rough outline like:
Make sure you print out the HTTP Content header before any output. Follow it by a blank line. They are running Python 2.6 I think. Definitely not 3.Code:#!/usr/bin/env python import os import sys print("Content-type: text/html") print("") print("<html>") print("<body>") print( "GET / POST Information") print("<pre>") print "Request method: " , os.environ[ 'REQUEST_METHOD' ] print "Query string: " , os.environ[ 'QUERY_STRING' ] count = 0 for line in sys.stdin: count = count + 1 print line if count > 100: break print "" print("</pre>") print("</body>") print("</html>")
3. If the script is in cgi-bin , you should be set to go
If it is anywhere else, make sure you have a line:
in your .htaccess fileCode:AddHandler cgi-script .py
4. If your script still flubs, post any error messages back here and I can try to help.
Thank you so much.
I was totally unaware of how to set permissions.
I just tried FileZilla and it worked.
Now, cgi works just fine.
Thank you.
Last edited by misson; 06-05-2010 at 12:15 AM.
Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.Misson, not Mission.