#!/bin/sh echo "Content-Type: text/html" echo "" echo "test"
1行目と2行目の空白がないと
とかいわれる.
sudo cat /etc/httpd/logs/error_log | tail
[Mon Dec 08 15:42:00 2014] [error] [client xxx.xxx.xxx.xxx] malformed header from script. Bad header=test: test.cgi
とりあえず,htmlで連携.
<html> <head> <html lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script> $(document).ready(function(){ alert("test"); $.get("../../../cgi-bin/test/test.cgi", function(data2){ alert(data2); $("div").html(data2); } ); }); </script> </head> <body> <div></div> </body> </html>