Perlインストール記録
なんだかんだでPerlを5.8.7から5.10.0にバージョンアップ。
CPANよりコードを落としてくる:http://www.cpan.org/
$ tar xvfz perl-5.10.0.tar.gz $ ./Configure -de -Duseshrplib $ make $ make test
「./Configure」のオプションに「-Dusershrplib」を付けると「libperl.a」及び「libperl.so」ができる。なんだけど〜「make test」でこけた。
エラーが発生している。
Failed 1 test out of 1382, 99.93% okay. ../ext/Sys/Syslog/t/syslog.t ### Since not all tests were successful, you may want to run some of ### them individually and examine any diagnostic messages they produce. ### See the INSTALL document's section on "make test". ### You have a good chance to get more information by running ### ./perl harness ### in the 't' directory since most (>=80%) of the tests succeeded. ### You may have to set your dynamic library search path, ### LD_LIBRARY_PATH, to point to the build directory: ### setenv LD_LIBRARY_PATH `pwd`:$LD_LIBRARY_PATH; cd t; ./perl harness ### LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd t; ./perl harness ### export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH; cd t; ./perl harness ### for csh-style shells, like tcsh; or for traditional/modern ### Bourne-style shells, like bash, ksh, and zsh, respectively. u=0.35 s=21.50 cu=183.54 cs=209.58 scripts=1382 tests=187599 make[2]: *** [_test_tty] エラー 1 make[2]: Leaving directory `/home/knoppix/perl-5.10.0' make[1]: *** [_test] エラー 2 make[1]: Leaving directory `/home/knoppix/perl-5.10.0' make: *** [test] エラー 2
いやいやながら英語のエラーを読むと、「LD_LIBRARY_PATH」が設定していないらしい。実際に設定してなかったの設定する。設定と言うか上記に書いてあるようにやる。
$ export LD_LIBRARY_PATH=`pwd` $ echo $LD_LIBRARY_PATH
これで、再度「make test」を実行しテストが通れば「make install」を実行。
エラー等沢山出たが最終的に実行したコマンドをまとめる。
$ tar xvfz perl-5.10.0.tar.gz $ ./Configure -de -Duseshrplib $ make $ make test # make install
今回インストールしたPerlの処理系は「/usr/local/bin/perl」となり、今まで利用していたPerlの処理系は「/usr/bin/perl」なのよん。当然、現時点で、「$ perl -v」とやったら「/usr/bin/perl」の旧版が動くんだわ〜これはどうするべき。私は念のため「/usr/bin/perl」をバックアップして、「/usr/local/bin/perl」にソフトリンクをはった。
# mv /usr/bin/perl /usr/bin/perl_back # ls -s /usr/bin/perl perl
その後、ある程度動かして新しくインストールしたPerlが問題なさそうであれば旧perl版は削除したけどね。そんな感じでいいよね。
それで重要なのは、「libperl.a」や「libperl.so」が作成されているかどうかなんだ。見たところ「libperl.so」はあったけど「libperl.a」は無かったね。まあ、問題ないだろ。その後、mod_perlのインストール。
$ perl Makefile.PL MP_APXS=/usr/local/apache2/bin/apxs $ make # make install +--------------------------------------------------------------+ | | | For details on getting started with mod_perl 2, see: | | | | http://perl.apache.org/docs/2.0/user/intro/start_fast.html | | | | | | Found a bug? File a bug report: | | | | http://perl.apache.org/bugs/ | | | +--------------------------------------------------------------+
成功した!うし!
knoppix@0[perl-5.10.0]$ cd /usr/local/apache2/modules/ knoppix@0[modules]$ ls -la 合計 212 drwxr-sr-x 2 root staff 112 2009-07-07 23:03 . drwxr-sr-x 15 root staff 360 2009-07-05 00:07 .. -rw-r--r-- 1 knoppix knoppix 9046 2009-07-05 00:05 httpd.exp -rwxr-xr-x 1 root staff 203415 2009-07-07 23:03 mod_perl.so
おお〜Apacheのモジュール格納場所にmod_perl.soができているよ。成功だね。次はmod_perlの勉強を行っていこうかな。では