Premature end of script headers とは

CGIファイルをWindowsのApacheなどで実行しようとすると、次のような500エラーが出ることがあります。

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

最後の1文で「ログファイルに詳細が書かれている」ということなのでログファイルを見ると次のように出ています。

Premature end of script headers: test.cgi

ディレクトリのパーミッションが間違っているかもしれません。
そのファイルがあるディレクトリのパーミッションが 755 以下であることを確認してください。

Linuxと同じ記述( #!/usr/local/bin/perl とか #!/usr/bin/perl )に合わせる方法
#!/usr/local/bin/perl でも #!/usr/bin/perl でも、どちらでも実行させる方法

関連記事

スポンサーリンク

暗号化・複合化を行う ブロック暗号

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る