我想獲得WWW :: Mechanize使用https登錄到雅虎;但是,它需要使用Crypt :: SSLeay通過https發送。爲什麼Perl模塊Crypt :: SSLeay在加載時會出錯?
Crypt :: SSLeay安裝成功,openssl已經安裝在系統上。
然而,它給在加載錯誤:
Can't load '/home/gen19/perl5/lib/perl5/lib/site_perl/5.10.1/i686-linux//auto/Crypt/SSLeay/SSLeay.so' for module Crypt::SSLeay: /home/gen19/perl5/lib/perl5/lib/site_perl/5.10.1/i686-linux//auto/Crypt/SSLeay/SSLeay.so: undefined symbol: PL_sv_undef at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/DynaLoader.pm line 229. at /home/gen19/lwp4 line 15 Compilation failed in require at /home/gen19/lwp4 line 15. BEGIN failed--compilation aborted at /home/gen19/lwp4 line 15.
地穴:: SSLeay的的安裝成功,並能識別的OpenSSL的安裝(在這裏):
perl Makefile.PL
=======================================================
Only one OpenSSL installation found at /usr
Consider running 'perl Makefile.PL --default' the next
time Crypt::SSLeay is upgraded to select this directory
automatically thereby avoiding the following prompt.
=======================================================
Which SSL install path do you want to use? [/usr] /home/gen19/ssldir
BUILD INFORMATION
================================================
ssl library: OpenSSL 0.9.8 in /home/gen19/ssldir
ssl header: openssl/ssl.h
libraries: -L/home/gen19/ssldir/lib -lssl -lcrypto -lgcc
include dir: -I/home/gen19/ssldir/include/openssl -I/usr/kerberos/include
================================================
Note (probably harmless): No library found for -lgcc
Writing Makefile for Crypt::SSLeay
The test suite can attempt to connect to public servers
to ensure that the code is working properly. If you are
behind a strict firewall or have no network connectivity,
these tests may fail (through no fault of the code).
Do you want to run the live tests (y/N) ? [N]
注意:由於LWP :: UserAgent的需要,最近安裝了使用App :: perlbrew的Perl v5.10.1。我使用我的Perl新版本安裝了Crypt :: SSLeay。
我沒有root priveldiges,因爲我在學校的遠程服務器上這樣做。請告訴我爲什麼即使它成功安裝,它也會出錯。我知道它與共享庫有關,但安裝程序會識別它們。
邊注意:如果我不說「使用Crypt :: SSLeay;」,我的腳本工作正常在開始的時候,但是當我使用https時它給出錯誤,它不是支持的協議,並且需要安裝LWP :: protocol :: https。安裝總是失敗。
編輯:感謝您的幫助,CJM。顯然,當我執行時,它使用舊版本的Perl,但現在我已經修復了這個問題。
它不再給出這個錯誤;然而,它仍然說
Error GETing https://login.yahoo.com/config/login_verify2?&.src=ym: Protocol scheme 'https' is not supported (LWP::Protocol::https not installed) at lwp4 line 14
我以爲Crypt :: SSLeay應該照顧這一點。
不,你需要安裝[LWP :: Protocol :: https](https://metacpan.org/pod/LWP::Protocol::https)。現在,[Crypt :: SSLeay](https://metacpan.org/pod/Crypt::SSLeay)將'LWP :: Protocol :: https'指定爲依賴項,所以我不知道爲什麼它沒有安裝。另外,[你可能不需要'Crypt :: SSLeay'](https://www.nu42.com/2014/08/dont-declare-dependency-on-cryptssleay.html)。 – 2016-08-09 03:10:01