アプリ版:「スタンプのみでお礼する」機能のリリースについて

質問失礼します。

GDBMを用いたプログラムをperlで作ったのですが、
solarisのコマンドラインから打ち込むと普通に実行出来ます。

しかし、webブラウザからCGIでsystem関数を使い
そのプログラムを呼び出すと実行出来ません。

どうやら
use GDBM_File;
の部分でエラーが起きているようです。


そこで、エラーログを見ると以下の記述がありました

[Wed Jan 23 17:17:13 2008] [error] [client 157.80.85.160] Can't locate GDBM_file.pm in @INC (@INC contains: /usr/perl5/5.8.4/lib/sun4-solaris-64int /usr/perl5/5.8.4/lib /usr/perl5/site_perl/5.8.4/sun4-solaris-64int /usr/perl5/site_perl/5.8.4 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int /usr/perl5/vendor_perl/5.8.4 /usr/perl5/vendor_perl .)~以下略


とにかく「Can't locate GDBM_file.pm ~」と書いてあるので
以下の文を「use GDBM_File;」の上に加えて、
探す場所を指定したのですが

use lib '/opt/csw/lib/perl/5.8.8';


今度は

[Wed Jan 23 20:15:05 2008] [error] [client 157.80.85.160] Can't load '/opt/csw/lib/perl/5.8.8/auto/GDBM_File/GDBM_File.so' for module GDBM_File: ld.so.1: perl: fatal: relocation error: file /opt/csw/lib/perl/5.8.8/auto/GDBM_File/GDBM_File.so: symbol Perl_croak_nocontext: referenced symbol not found at /usr/perl5/5.8.4/lib/sun4-solaris-64int/XSLoader.pm line 68., ~以下略

と出てきて、実行されません
パーミッションも「444」で読み込みは出来るようになっているはずです

どなたかこのエラーの解決法がわかる方はいませんでしょうか?
ご教授願います。

A 回答 (1件)

>/usr/perl5/5.8.4/lib/sun4-solaris-64int


>/opt/csw/lib/perl/5.8.8/auto/GDBM_File/GDBM_File.so:

Perlのバージョンが違いますけど、コンパイルした条件が違ってたりしませんか?
CGIのスクリプトの先頭にあるshebang行(#!... ってやつです)と
シェルのコマンドラインで
which perl
とかしたときのperlの位置はそれぞれどうなってますか?


以下FAQから
http://hio.jp/translation/perldoc/pod/perlsolari …

Dynamic Loading Problems With GNU as and GNU ld

If you have problems with dynamic loading using gcc on SunOS or Solaris, and you are using GNU as and GNU ld, see the section GNU as and GNU ld above.
ld.so.1: ./perl: fatal: relocation error:

If you get this message on SunOS or Solaris, and you're using gcc, it's probably the GNU as or GNU ld problem in the previous item GNU as and GNU ld.
dlopen: stub interception failed

The primary cause of the 'dlopen: stub interception failed' message is that the LD_LIBRARY_PATH environment variable includes a directory which is a symlink to /usr/lib (such as /lib). See LD_LIBRARY_PATH above.
#error "No DATAMODEL_NATIVE specified"

This is a common error when trying to build perl on Solaris 2.6 with a gcc installation from Solaris 2.5 or 2.5.1. The Solaris header files changed, so you need to update your gcc installation. You can either rerun the fixincludes script from gcc or take the opportunity to update your gcc installation.
sh: ar: not found

This is a message from your shell telling you that the command 'ar' was not found. You need to check your PATH environment variable to make sure that it includes the directory with the 'ar' command. This is a common problem on Solaris, where 'ar' is in the /usr/ccs/bin/ directory.
    • good
    • 0
この回答へのお礼

回答ありがとうございます。
結論から言うと、なんとか解決しました。

拡張子が.plだとGDBMが読み込めず
拡張子を.cgiにするとなぜかGDBMが読み込めました。


apacheの設定がおかしかったか、
perlのバージョン違いの問題だったのでしょうか
古いバージョンのperlも混在していましたので…

ちなみに使っているperlの位置は

[自分]% which perl
/opt/csw/bin/perl

で、パスは間違いなく書いたはずなんですが…


説明不足な質問に付き合って頂いて
ありがとうございました。

お礼日時:2008/01/25 19:15

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!