logdog Posted March 7, 2020 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.
Krydos Posted March 7, 2020 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
logdog Posted March 7, 2020 Author 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.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now