2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

「500 Internal Server Error」がでたとき、2度も同じ失敗

Last updated at Posted at 2016-09-30

結論を先に

print "Content-type:text/html\n\n";

が、抜けていた。
2回も同じ失敗をした。

cgiを実行したときに Internal Server Error となった。

その前にコマンドラインから実行して、パラメータを渡してのテストも
行っている。

コマンドラインから動いて、ブラウザからjavascript経由で
実行するとエラーになってしまう。

原因を検索すると、
・CGIファイルやディレクトリのパーミッションに誤りがある。
・.htaccess の記述、書式、コードに誤りがある。
・CGIプログラムの設定に誤りがある(CGI内部エラー)
と出てくる。

いや、だからプログラムは動くのに…

毎回パーミションは気にしてしまう。それ以前の問題だった。

※ 補足 「End of script output before headers: ecoDBinsertPl.cgi」
insert文は正しく実行されるのに、上記のログが出力されていた。

これもまた、Content-typeを書いていなかったことが原因だ。
cgiを実行する側に値を返さないので、Content-typeのprintを削除したら
エラーになった。
そうなんだ、へぇという感じです。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?