• 締切済み

require文が実行できない

perl で require 'cgi-lib.pl'; または require "jcode.pl"; を実行すると、 Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, admin@mshome.net 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. というメッセージが出ます。(cgi-lib.pl、jcode.plは同じディレクトリにあります。)

  • Perl
  • 回答数8
  • ありがとう数9

みんなの回答

  • hara_peko
  • ベストアンサー率28% (11/38)
回答No.8

ローカルで試されているとのことなので More information about this error may be available in the server error log. とあるのならログをみてみてはどうでしょう。

WETCOLD
質問者

お礼

ありがとうございます。  ログを見たら  ./cgi-lib.pl did not return a true value at -----  とあったので、cgi-lib の方がまずいと思いましたが、  何度か 起動させると正常になります。(つまり、不安定。require文が原因ではないでしょう。その前に jcode.pl はPCの時間が 10/31 になっていたので 正常な 10/1 に修正したら、エラーは消えました。マザーの電池を変えることにします。なんで、 jcode.pl に関係するのか? マザーの電源を 一日 カットして分かったことです。変な時間に勝手に起動したりしていたし。)

  • hok212
  • ベストアンサー率66% (100/150)
回答No.7

よくエラーメッセージを見ると「admin@mshome.net」という文字がありますね。 httpd は IIS か PersonalWebServer でしょうか? それとOSはなにをお使いですか? ※ .plがCGIとしてサーバに認識されてないような気がします。

WETCOLD
質問者

お礼

ありがとうございます。  ANO.8 のとうりです。

  • Mulumba
  • ベストアンサー率45% (27/59)
回答No.6

ローカルで実行しているのなら、PerlをインストールしたディレクトリのLibの中にcgi-lib.pl、jcode.plを置いてみたらどうでしょうか。 自信ないですが。

WETCOLD
質問者

お礼

ありがとうございます。  ANO.8 のとうりです。

  • hok212
  • ベストアンサー率66% (100/150)
回答No.5

FTPクライアントが拡張子 .pl のファイルをバイナリモードでアップロードしてる可能性があります。 アスキーモード(テキストモード)でアップロードしてみてはどうでしょうか?

WETCOLD
質問者

お礼

ありがとうございます。  ANO.8 のとうりです。

  • hara_peko
  • ベストアンサー率28% (11/38)
回答No.4

下記のサイトを参考にしてみて下さい。 Perlの文法に関するエラーなのかそれ以外の原因なのか区別する手助けになると思います。

参考URL:
http://homepage1.nifty.com/typhoon/at-cgi/debug.html
WETCOLD
質問者

お礼

ありがとうございます。  ANO.8 のとうりです。

  • moon_night
  • ベストアンサー率32% (598/1831)
回答No.3

まさか実行するPerlのプログラムのパーミッションがおかしいなんてオチではないですよね?

WETCOLD
質問者

お礼

ありがとうございます。  1.実行しているのは、転送前のローカルのWebサーバーの段階です。  2.perl -c でチェックすると syntax OK です。  3.ローカルでの パーミッション変更方法は分かりません。

  • Mulumba
  • ベストアンサー率45% (27/59)
回答No.2

#1です。 実際にディレクトリから削除して試して見たのでしょうか? サーバによっては、cgi-lib.pl、jcode.pl等を自分で置かなくても、requireで呼び出して使える場合があり、その場合自分で置くと逆にエラーとなる場合があります。 削除してもだめなら、私にはお手上げです。 まさか実行するPerlのプログラムとcgi-lib.pl、jcode.plが別のディレクトリにあるなんてオチではないですよね?

WETCOLD
質問者

お礼

ありがとうございます。  1.削除しても同様でした。  2.同じディレクトリです。  3.use encoding "shift_jis"; で日本語対応させることはできます。

  • Mulumba
  • ベストアンサー率45% (27/59)
回答No.1

cgi-lib.pl、jcode.plをディレクトリから削除してみる。 これでだめなら、cgi-lib.pl、jcode.plをディレクトリに戻した状態で、 require './cgi-lib.pl'; require "./jcode.pl"; と変更してみる。

WETCOLD
質問者

お礼

ありがとうございます。   cgi-lib、jcode,pl を使用するのが目的です。(削除)   require './cgi-lib.pl'; require "./jcode.pl"; に変更しても同じでした。

関連するQ&A

  • Internal Server Error???

    こんにちは。 CGIを作ったのですが、 【Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@life-web.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. 】 と言うエラーが出て動きません. もう一つ同じようなcgiを作ったのですが、そちらは普通に動きます.すみませんが、このエラーの場合はどうしたらいいですか? CGIはメールフォームからのメールを送信するものです。

    • ベストアンサー
    • CGI
  • 【CGI】メールフォームが動作しない

    http://apps.cside.com/ こちらの「基礎メール2nd」というものをさくらサーバーで運用しようと考えています。 下記の階層にし、パーミッションも括弧の様に設定しました。 form/ (755) │ ├ input.html (644) ├ finish.html (644) ├ sendmail.cgi (755) │ ├ data/ (777) │ └ lastmail.cgi (666) │ ├ lock/ (777) │ └ flock.cgi (666) │ └ lib/ (755) ├ ap_mimeenc.pl (644) └ jcode.pl (644) そのほか変更したのは 「sendmail.cgi」というファイルを変更しました。 1行目に #!/usr/bin/perl と変更。 $sendmail = '/usr/sbin/sendmail'; ここはさくらサーバー指定のパスに $mail_to_addr = '*****.sakura.ne.jp'; 実際に届いてほしいアドレスに。 という具合に変更しました。 そのほかはとりあえず動くことを確認したかったので、編集しておりません。 この状態で送信ボタンを押したところ。 ■■■■■■■■■■■■■■ Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, support@sakura.ad.jp 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. Apache/1.3.39 Server at *****.sakura.ne.jp Port 80 ■■■■■■■■■■■■■■ と表示されました。 原因が分からず困っています。 他に必要な情報がありましたらいってください。 宜しくお願いいたしますm(__)m

    • ベストアンサー
    • CGI
  • cgi-lib.plのReadParse関数

    あるパールからcgi-libを呼び出して、ReadParse関数を使おうとするとInternal Server Errorがでてしまいます。 パールの中身は #!/usr/local/bin/perl require 'cgi-lib.pl'; require 'jcode.pl'; &ReadParse(*in); です。 そこで3行目と5行目の行頭に#をつけて飛ばすとパールは正常に動きます。 これってcgi-lib.plのReadParse関数がいけないんでしょうか? ダウンロードしたまま何も変更していないのに..... ちなみにサーバーのパールのバージョンは5.004のようです。

    • ベストアンサー
    • CGI
  • 500 Internal Server Error

    http://iboard3.to/ で始まるURLのどのサイトでも 500 Internal Server Error Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, info@iboard2.to 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. と表示され、見ることができません。 どうしたらよいですか?

  • mixiで動画をUPしたら・・・・

    mixiで動画をUPしたら・・・・ Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, mixi 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. というエラーが出たんですが、今になっても直りません。 どうすればよいですか?

  • 教えてgooサーバーエラー

    すみません 教えてgooでInternal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, root@ask01.goo.ne.jp 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. という表記が出てきます。 よく意味が分からないのですが、どのように対処すればよいのでしょうか よろしくお願いします

  • あるHPにアクセスしてのエラー

    以下のエラーが出ました。これは、私の方のせいですかね?いきなり英語でエラーメッセージが出ても・・・ Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, あるHPのアドレス 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. どうしたらいいのでしょうか?

  • 続・メールの送信

    Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster 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. -------------------------------------------------------------------------------- Apache/2.0.39 Server at www.altoworld.com Port 80 こんな表示が出て、白紙でメールだけは届きます

    • ベストアンサー
    • CGI
  • CGIの暴走で、500エラーになり修復できません。

    現在、借りているサーバーで大量にメールマガジンを配信したところ急に、他のショッピングカートなどの CGIが以下の様なエラーになりました。 どうすれば修復できるのでしょうか? > Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, root@ドメイン名 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. -------------------------------------------------------------------------------- Apache/1.3.33 Server at ドメイン名 Port 80

    • ベストアンサー
    • CGI
  • 分かりません。誰か教えて2

    午前中に質問させて貰ってかなり分かるようになりました。みなさん有り難う。(^^; 今、掲示板の作成をしているわけですがうまいこといきません。で、サーバーはインターQです。 インターQのテスト用のCGIは動くようになりました。 で、本体の方をアップしたところこのようなエラーがでました。「The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, customer@cgi06.interq.net 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.」 この場合なにがいけないのでしょう? 分かる方教えてください。

    • 締切済み
    • CGI