theil Posted December 31, 2017 Posted December 31, 2017 I try to write an easy basic CGI in python and get this Internal server error 500. What am I doing wrong? user/script theil.heliohost.org/cgi-bin/hello-get.py on johnny just a "Hello World" #!/usr/bin/python[LF]print("Content-Type: text/html\n\n")[LF]print("Hello")[LF] + The [LF] are the right line endings with notepad++.+ I changed the permissions on Windows to everyone. Why can´t it just work... Thanks in advance! Andy
Krydos Posted December 31, 2017 Posted December 31, 2017 The hello-get.py script is currently 664. It needs to be 755. You didn't make it executable.
theil Posted January 1, 2018 Author Posted January 1, 2018 Thanks, hope in sight *g*Any suggestion how I would do that easiest in Win10?(i clicked right/security/everyone in dir already can do all... and still 664?) That would be a FAQ topic for implementing Python as CGI...
Krydos Posted January 1, 2018 Posted January 1, 2018 Log in to cpanel, click file manager, navigate to your file, highlight it, and click the permissions button in the top right area.
theil Posted January 1, 2018 Author Posted January 1, 2018 Happy 2018! Permissions don't work with 777. Thnx, Andy
theil Posted January 2, 2018 Author Posted January 2, 2018 Finally. Set permissions to 755, now it works. Why? Don't ask me. But hope others will find this helpful. -> set to 755 in cpanel/file manager (no write world/group)-> use notepad ++ in windows, just lf no cr Solved so far. Thnx.
Luigi123 Posted January 2, 2018 Posted January 2, 2018 Im glad its working for you. Let us know if you need any help or have any questions.
wolstech Posted January 2, 2018 Posted January 2, 2018 If it's anything like what causes this for php, it's because of the group attribute (the second number in the permissions). The files cannot be writable by the group. It'd be a bad idea from a security standpoint to have stuff writable by the public too, unless it's something meant for that, like a folder for public file uploads.
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