logdog Posted March 7, 2020 Share Posted March 7, 2020 I'm on johnny.both files in cgi-bin w/ 755 This (lf37.py) gives me 500 error#!/usr/bin/python3.7 print("Content-Type: text/html\n\n") print("Heliohost rules!") This (lf27.py) works#!/usr/bin/pythonimport sys print "Content-Type: text/html\n\n" print "Heliohost rules!\n\n<BR>" print sys.version_info Please advise. Quote Link to comment Share on other sites More sharing options...
Krydos Posted March 7, 2020 Share Posted March 7, 2020 The difference is lf37.py has dos line endings, and lf27.py has linux line endings. This usually means that you created the lf37.py file on a windows computer and then uploaded it. To avoid a 500 error you must make sure your files have linux line endings. I've never used it myself, but I've heard the windows program notepad++ can save files with linux line endings. I'm sure there are others as well. 1 Quote Link to comment Share on other sites More sharing options...
logdog Posted March 7, 2020 Author Share Posted March 7, 2020 Thanks!That explains a lot. I was creating some files on Windows and some locally in cpanel/editor, thus the mixed results. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.