HelioHost Posted November 27, 2017 Posted November 27, 2017 Username: jthorne, Server: Johnny, Main domain: jthorne.heliohost.org Sorry to be that guy, but I've tried everything, and I'm still getting anerror 500 attempting to run a Python script of any kind on a Johnny-hostedsite. Permissions on the file (and cgi-bin folder) are 755 I've tried adding a cgi-script .py handler to Apache using the ApacheHandlers 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 fromjavascript. 500, 500, 500. I've tried a .py file with plain text in it, as well as aproperly-formatted script with the shebang, import cgi, content-typeheader, etc., but I get the same error no matter what, implying that it'snot even attempting to execute. What am I missing? (Honestly, I'd rather do ajax using JSON POST data, but at this point, I'mjust testing a hello world to see if can get the server to do anything, andcgi is often the quickest and easiest way to test that.)
Krydos Posted November 28, 2017 Posted November 28, 2017 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')
Recommended Posts