• 締切済み

見本のCGIをマニュアル通りに置いたのですが

CGIのテキストどおりに、サンプル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. This is typically a problem if the script was edited or uploaded from a DOS/Windows/Macintosh station to a unix based server. 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/. 英語がさっぱり分からないのでなにがどうまずいのか全くわかりません。 メッセージの意味の分かる方是非、解説お願いします。

  • zagan
  • お礼率50% (3/6)
  • CGI
  • 回答数6
  • ありがとう数9

みんなの回答

  • nightowl
  • ベストアンサー率44% (490/1101)
回答No.6

すみません、No.5 について訂正させてください。 (誤)バイナリモード→(正)テキスト(アスキー)モード でした。 あと、参考 URL も見てください。

参考URL:
http://www1.plala.or.jp/bagi/setupcgi.html
zagan
質問者

お礼

色々とお手数かけてすみません。 参考URLをじっくり読んで勉強します。

  • nightowl
  • ベストアンサー率44% (490/1101)
回答No.5

最後の2行も気になりますね。 行末が LF のみでバイナリモードでもだめならこれが一番臭いかな? 「あなたがこのスクリプトの所有者でなければ、 このエラーと URL をスクリプトの所有者に転送してください」とあります。 所有者権限が管理者のものになっていると考えられます。 エラーメッセージが「/cgiwrap/」の直後の URL 文字列に含まれているのではないですか? 管理者にその旨伝えてみるほかないと思います。

noname#5179
noname#5179
回答No.4

あっ、ごめんなさい。よく英語を読まずに回答してしまいました。他の方の回答が正しいと思います。

  • MovingWalk
  • ベストアンサー率43% (2233/5098)
回答No.3

英語が得意でなければこちらを利用してみてください。 http://www.excite.co.jp/world/text/ control-M's(CR)が行末にあるのでこれを除去する必要があります。 Windows環境からUNIX環境にFTPで転送したのでしたら、もう一度転送しなおして下さい。 その時は、転送モードを、バイナリモードではなく「テキストモード」にしてください。

zagan
質問者

お礼

回答有り難うございます。 まだ、色々試しましたがまだ、うまくいきません。 自力でもう少し頑張ってみます。

  • nightowl
  • ベストアンサー率44% (490/1101)
回答No.2

DOS または Windows または Macintosh で作成したスクリプトを UNIX サーバにアップロードしたときに起こる典型的な問題だと書いてありますね。 Windows と UNIX とでは行末の改行コード(前者は CR+LF、後者は LF のみ)が異なることが原因です。 余計な CR コードが邪魔になって実行できませんといっているのです。 CR(^M)コードを削除することができれば一番なのですが、手っ取り早い解決策として スクリプト1行目の「#!/.../perl」(Perl の絶対パスが入る)のところを 「#!/.../perl --」に書き換えれば動くとあります。 試してみましょう。

zagan
質問者

補足

アドバイス有り難うございます。もう少し聞いてもいいでしょうか? MACで作っていますが、改行コードは保存時にLFに変換しています。 それだけじゃいけないんでしょうか?

noname#5179
noname#5179
回答No.1

perlスクリプトの1行目は以下のようになっています。 例)#!/usr/local/bin/perl 「/usr/local/bin/perl」の部分は、使うサーバによって、異なります。 この部分は、「perlまでのパス」と呼ばれます。 使いたいサーバーの「perlまでのパス」を調べて直してください。 とりあえず、これがもっとも考えられる原因と思います。

zagan
質問者

お礼

早速のアドバイス有り難うございます。 パスの確認してみます。

関連するQ&A

  • CGI-PLANTさんの「切り出し日記」

    こんにちわ。 ここんとこ、CGIの質問ばかりですいません… で、今回は、CGI-PLANTさんの「切り出し日記」なんですが、昔、一回使ったことがあり、そのときは、ふっつ~に動きました。 最近また使おうと思ってHPからDLしてサーバへUPして、アクセス権も変更して、いざ行かん!と思ったら、エラーが出て動きません……perlのパスはあってるし、他はまだいじってないし…アクセス権が違うとは考えにくいですし… errorは「CGIWrap Error: Script Execution Failed CGIWrap encountered an error while attempting to execute this script: Error Message: No such file or directory Error Number: 2 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/. 」 って感じです。翻訳機かけても意味不明だし、#!/.../perl --'って書いてあるところを見るとパスが違うみたいだけどあってるし…分かる人いますか? 宜しくお願いします

    • 締切済み
    • CGI
  • CGIが分かりません

    ホームページをリニューアルするということで、一度アップしていたものをすべて削除し、新しく作り直したホームページをFFFTPでアップしました。 すると、以前まで使えていたフォームメールが使えなくなってしまいました。 「予約」と「お問合せ」と2つ作っていたのですが、「お問合せ」のほうはなぜかうまく繋がるのですが、「予約」のほうは以下のようなエラー文がでてしまいます。 CGIWrap Error: Script Execution Failed -------------------------------------------------------------------------------- CGIWrap encountered an error while attempting to execute this script: Error Message: Permission denied Error Number: 13 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. This is typically a problem if the script was edited or uploaded from a DOS/Windows/Macintosh station to a unix based server. 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/. -------------------------------------------------------------------------------- Local Information and Documentation: Contact Name: Administrator Contact EMail: admin Server Data: Server Administrator/Contact: admin Server Name: www.tsurugagolf.co.jp Server Port: 80 Server Protocol: HTTP/1.1 Virtual Host: www.tsurugagolf.co.jp Request Data: User Agent/Browser: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.6) Request Method: POST Remote Address: 210.143.245.129 Remote Port: 59165 Extra Path Info: /cgi-bin/yoyaku/postmail/postmail.cgi 削除してアップしなおしただけなので、以前使われていたCGIやその他は変更していないつもりなのですが、すべてエラーがでてしまうようになってしまいました。 コンピュータのことはあまり詳しくないので難しくてさっぱりわかりません。 最初のホームページは私が作っていたわけではないので詳しいことはわからないのですが、 新しいホームページのフォームメールは使われていたものをそのまま持ってきました。 すべてが初心者なので困っています。

  • 100回読んでも解らない

    Of course, there exists the possibility that TV isn't the problem, and instead unhappy people turn to this form of entertainment as a refuge. すっきりと理解できません教えてください。

  • アンケートCGIについて

    よろしくお願い致します。 ホームページにアンケートを設置したく、http://www.rescue.ne.jp/cgi/weban/ にあるCGIをダウンロードさせて頂いたのですが、必要なファイルを全てサーバーにアップしたのですが、an.cgiが正常に動作しません。 an.cgiにアクセスしたときに表示されるエラーメッセージは、以下のようになっております。 ---------------------- Script Error The script did not produce proper HTTP headers. Please see the error log to see the detail of the errors. Depending on the server configuration, you can also run thisscript under CGIWrap debugging. Usually, either rename or linkthe script temporarily to a file which ends with .cgidextension, or add a AddHandler cgi-script-debug .cgiline to your .htaccess file. ---------------------- サーバーはxreaを使用しており、パーミッションは705(xrea推奨)でアップしています。他のcgi(メールフォー等)も同様のパーミッションでアップして正常に動作しているので、パーミッションの問題ではないと思うのですが..。 何が原因なのか、お分かりになる方がいらっしゃいましたら、どうかご教授下さいますようお願い致します。

    • ベストアンサー
    • CGI
  • 和訳が分かりません。

    That sort of overall sustainable energy problem is the biggest problem that we have to solve this century, independent of environmental concerns 上記の文章なんですが、independent.. の部分がうまく訳せません。 これな文法的にどのような役割なのでしょうか。

  • 最近mailをはじめたら

    Your message was successfully delivered to its final destination. This is a notification of that fact, as you requested. Please reply to Postmaster@*****.*****.**.jp if you feel this message to be in error. 送信すると必ずこのmailが届きます。 この意味が全然わかりません。 何か間違って送信しているのでしょうか?

  • 和訳をお願いします。

    Since all hypochondriacs (and, I’m afraid, people in general)have a propensity to jump to the worst rather than the best conclusions, this new breed of hypochondriac is apt to assume that he or she is seriously, even fatally , ill . How scary is that? Another related problem is that patients armed with web-based medical knowledge often dispute or refuse to accept the advice and diagnoses of medical professionals. This can make it very difficult for doctors to properly administer medical care. Some doctors, however, don’t mind their patient’s being so knowledgeable since it can help to improve doctor/patient communication. By the way, a 2008 study conducted by Microsoft found that more than half of the people surveyed admitted that online medical searches often interfere with their daily activities. All this makes me wonder if there isn’t such a thing as being too health-conscious.

  • 添削してください。

    Consider Michael Huemer’s “problem of political authority.” Do you agree that this is a problem? 私はこの問題に賛成だ。Huemerが書いているように、個人の行動を評価するときと政府の行動を評価するときでは一致しないのはおかしい。市民が政府に特別の立場を認めることは間違っていると思う。 I agree that this is a problem. Becaue according Huemer, it is strange that it does not acord when evaluating personal behavior and when evaluating government actions. I think it is wrong that citizens admit special position to the government. という内容の回答をしようと思っているのですが、 こちらの英文の添削をして欲しいです。 よろしくおねがいします。

  • だれかこの英文を解読お願いします(>人<;)

    This Message was undeliverable due to the following reason: Your message was not delivered because the destination computer was not found. Carefully check that it was spelled correctly and try sending it again if there were any mistakes. It is also possible that a network problem caused this situation, so if you are sure the address is correct you might want to try to send it again. If the problem continues, contact your friendly system administrator. Host i.docomo.nejp not found. The following recipients did not receive this message: This Message was undeliverable due to the following reason: Your message was not delivered because the destination computer was not found. Carefully check that it was spelled correctly and try sending it again if there were any mistakes. It is also possible that a network problem caused this situation, so if you are sure the address is correct you might want to try to send it again. If the problem continues, contact your friendly system administrator. Host i.docomo.nejp not found. The following recipients did not receive this message: Please reply to <Postmaster@i.softbank.jp> if you feel this message to be in error. Please reply to <Postmaster@i.softbank.jp> if you feel this message to be in error.

  • 英文

    どちらがいいでしょうか? This is a CD which Tom often listens to. または、 This is the CD which Tom often listens to.

専門家に質問してみよう