python - run .py files on server - getting error 500 -
python - run .py files on server - getting error 500 -
i'm trying run simple python script in server (hostgator) , i'm getting error 500 when run in url.
this .py file: (in public_html folder) chmod:755
#!/usr/bin/env python print "content-type: text/html\n\n"; print "<html><head>"; print "<title>cgi test</title>"; print "</head><body>"; print "<p>test page using python</p>"; print "</body></html>";
and .htaccess: (in public_html folder)
addtype text/html py addhandler cgi-script .py
couple of things might wrong:
allowoverride fileinfo
not set directory. 500 may indicate apache has issue "malformed" .htaccess
no executable bit on file:
$ chmod +x my.pysuexec gets in way. simple test is:
$ suexec=$(which suexec) $ mv ${suexec} ${suexec}.orig $ service httpd restartin case of suexec there several things can do:
trace permissions , other items might preventing suexec normal operation disable suexec removing/renaming it's executable use scriptalias define location scripts (this seems sidestep suexec completely) python .htaccess server
Comments
Post a Comment