0
votes

I am using XAMPP on Windows 8.1 machine. I am placing a basic hello world python script in the cgi-bin. I can run the script without error from the command line but when I try and call it up from my browser I get an Error 500. The error log states:

[Fri Sep 29 11:06:36.996021 2017] [cgi:error] [pid 5696:tid 1728] [client 192.168.1.6:49556] AH01215: print "Content-Type: text/plain;charset=utf-8"\r

[Fri Sep 29 11:06:36.996021 2017] [cgi:error] [pid 5696:tid 1728] [client 192.168.1.6:49556] AH01215: ^\r

[Fri Sep 29 11:06:36.996021 2017] [cgi:error] [pid 5696:tid 1728] [client 192.168.1.6:49556] AH01215: SyntaxError: invalid syntax\r

I used Sublime to write the code in Windows. I have changed the line ending in Sublime to Unix, Windows, and MacOS, received the same error for all three. I then opened my Linux machine and used VI to write the program ensuring the permissions were set to 777(just for test). Put the file in the cgi-bin folder and continue to get the same error. I even tried using rstrip() but a '\r' ends up at the end of that line also...

1

1 Answers

0
votes

It seems there is issue with the content type, try changing print content type line with this:

Content-type:text/html\r\n\r\n