Jump to content

Recommended Posts

Posted

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/python
import sys
 
print "Content-Type: text/html\n\n"
 
print "Heliohost rules!\n\n<BR>" 
print sys.version_info
 

Please advise.

Posted

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.

  • Like 1
Posted

Thanks!

That explains a lot.

 

I was creating some files on Windows and some locally in cpanel/editor, thus the mixed results.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...