[問題] cgi請益

看板Web_Design作者 (qq)時間10年前 (2015/07/08 14:35), 編輯推噓0(002)
留言2則, 1人參與, 最新討論串1/1
請問一下版友,目前我在raspberry pi上設定cgi會出現500error訊息 以上提供我設定的內容,可以幫我看哪裡有錯嗎?我是安裝lighttpd #這是我的測試程式我有設定chmod 755'放在/var/www/cgi-bin下檔名是index.py -------------------- #!/usr/lib/python2.7 print "Content-type:text/html\r\n\r\n" print '<html>' print '<head>' print '<title>Hello Word - First CGI Program</title>' print '</head>' print '<body>' print '<h2>Hello Word! This is my first CGI program</h2>' print '</body>' print '</html>' --------------------------- 以下是lighttpd.conf的設定 -------------------------------------- server.modules = ( "mod_access", "mod_alias", "mod_compress", "mod_redirect", "mod_cgi", "mod_rewrite", ) server.document-root = "/var/www" server.upload-dirs = ( "/var/cache/lighttpd/uploads" ) server.errorlog = "/var/log/lighttpd/error.log" server.pid-file = "/var/run/lighttpd.pid" server.username = "www-data" server.groupname = "www-data" server.port = 80 index-file.names = ( "index.php", "index.html", "index.lighttpd.htm l", "index.py" ) url.access-deny = ( "~", ".inc" ) static-file.exclude-extensions = ( ".php", ".pl", ".fcgi",".py" ) compress.cache-dir = "/var/cache/lighttpd/compress/" compress.filetype = ( "application/javascript", "text/css", "text/ht ml", "text/plain" ) # default listening port for IPv6 falls back to the IPv4 port include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port include_shell "/usr/share/lighttpd/create-mime.assign.pl" include_shell "/usr/share/lighttpd/include-conf-enabled.pl" cgi.assign = ( ".py" => "/usr/lib/python2.7" ) -------------------------------------------------------- -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.224.211.114 ※ 文章網址: https://www.ptt.cc/bbs/Web_Design/M.1436337309.A.762.html

07/09 13:01, , 1F
你第一行就寫錯了吧,怎會是 /usr/lib/python...
07/09 13:01, 1F

07/09 13:02, , 2F
至少也是 #!/usr/bin/python
07/09 13:02, 2F
文章代碼(AID): #1LdCITTY (Web_Design)