Jump to content

Recommended Posts

Posted

Username: jthorne, Server: Johnny, Main domain: jthorne.heliohost.org

 

Sorry to be that guy, but I've tried everything, and I'm still getting an

error 500 attempting to run a Python script of any kind on a Johnny-hosted

site.

 

Permissions on the file (and cgi-bin folder) are 755

 

I've tried adding a cgi-script .py handler to Apache using the Apache

Handlers form

 

I can't add an .htaccess file using the file manager

 

I've tried navigating to the script in a browser, and POSTing to it from

javascript. 500, 500, 500.

 

I've tried a .py file with plain text in it, as well as a

properly-formatted script with the shebang, import cgi, content-type

header, etc., but I get the same error no matter what, implying that it's

not even attempting to execute.

 

What am I missing?

 

(Honestly, I'd rather do ajax using JSON POST data, but at this point, I'm

just testing a hello world to see if can get the server to do anything, and

cgi is often the quickest and easiest way to test that.)

Posted

The problem is you don't have the required blank line between your header and your content. Since there is no blank line apache assumes the whole thing is the header, and you get a 500 error. To fix it change

 

print('Content-type: text/html')

 

to

 

print('Content-type: text/html\n\n')

Guest
This topic is now closed to further replies.
×
×
  • Create New...