Jump to content

Recommended Posts

Posted

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

Posted

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...

Posted

Log in to cpanel, click file manager, navigate to your file, highlight it, and click the permissions button in the top right area.

Posted

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.

Posted

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.

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...