【发布时间】:2011-08-27 14:57:05
【问题描述】:
我正在尝试让 WWW::Mechanize 使用 https 登录到 Yahoo;但是,它需要使用 Crypt::SSLeay 来通过 https 发送。
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.
Crypt::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]
注意:最近使用 App::perlbrew 安装了 Perl v5.10.1,因为 LWP::UserAgent 需要它。我使用新版本的 Perl 安装了 Crypt::SSLeay。
我没有 root 权限,因为我在学校的远程服务器上执行此操作。请告诉我为什么即使安装成功也会出现错误。我知道这与共享库有关,但安装识别了它们。
旁注:如果我不说“使用 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。现在,Crypt::SSLeay 将
LWP::Protocol::https指定为依赖项,所以我不知道为什么它没有安装。另外,you probably don't needCrypt::SSLeay.
标签: perl module openssl perl-module