Raspberry Pi : Apache & Python Error 500

Raspberry Pi Apache Error

I am trying to make some homemade domotica and I tested everything on my mac. That was working, but when I transfered everything to the Raspberry Pi, I had the server 500 error.

Screen Shot 2015-12-29 at 21.04.01

Perl was working fine, but not the python scripts. I googled for an hour and didn’t see any good working solution.

Finally I found the solution. The header wasn’t correct !

[Tue Dec 29 21:04:01.407175 2015] [cgid:error] [pid 24934:tid 1946154032] [clien
t 192.168.5.122:63715] malformed header from script 'test.py': Bad header: /usr/
lib/cgi-bin

 

Solution for Python script in cgi-bin :

#!/usr/bin/python 
print '\r' 

And now your script.

Leave a Reply