トップページ > 記事閲覧
C言語CGIが動かない
投稿日 : 2015/05/14(Thu) 19:38
投稿者 lisyunn
参照先
C言語でコンパイルされたcgiがサーバ上に動かない。
何か注意点があるのでしょうか?
local linux で確認済みのバイナリ”test.cgi”を
該当サーバーにあげ、実行したら下記のエラーが出ています。

正しい方法を教えてください。

※ちなみにperlのcgiがちゃんと動くことが確認できました。
----
CGIWrap encountered an error while attempting to execute this script:

Error Message: Exec format error
Error Number: 8

This message usually indicates there is a problem with the script itself. Often this indicates either that the #! line of the script is incorrect, or the script was uploaded in binary mode instead of ascii mode. Check to make sure that the script does not have control-M's at the end of every line. That will prevent it from executing. An easy fix that takes care of this most of the time is to put '#!/.../perl --' instead of '#!/.../perl' on the first line of the script.

If you are not the owner of this script, please forward this error and the URL that caused it to the script owner. That is often the component in the URL right after /cgiwrap/.


----
Re: C言語CGIが動かない
投稿日 : 2015/05/19(Tue) 10:56
投稿者 スタッフ ◆E/OpKM6SnFQ
参照先
lisyunn 様

平素は弊社サービスをご利用いただき、誠にありがとうございます。
いただきました件につきまして、念のために確認させていただきますが、test.cgi を弊社サーバーにFTPアップロードする際に、バイナリモードでアップロードされましたでしょうか。

以上、お手数をおかけいたしますが、お教えいただければ幸いです。