为什么 Perl 模块 Crypt::SSLeay 在加载时出错?

发布于 2024-11-08 02:00:34 字数 2378 浏览 5 评论 0原文

我正在尝试让 WWW::Mechanize 使用 https 登录雅虎;但是,它需要使用 Crypt::SSLeay 通过 https 发送。

Crypt::SSLeay 安装成功,并且 openssl 已经安装在系统上。

但是,它在加载时给出错误:


无法加载模块 Crypt::SSLeay 的“/home/gen19/perl5/lib/perl5/lib/site_perl/5.10.1/i686-linux//auto/Crypt/SSLeay/SSLeay.so”:/home/gen19 /perl5/lib/perl5/lib/site_perl/5.10.1/i686-linux//auto/Crypt/SSLeay/SSLeay.so:未定义符号:PL_sv_undef 位于 /usr/lib/perl5/5.8.0/i386-linux- thread-multi/DynaLoader.pm 第 229 行。 在 /home/gen19/lwp4 第 15 行 /home/gen19/lwp4 第 15 行的 require 编译失败。 BEGIN 失败——编译在 /home/gen19/lwp4 第 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权限,因为我是在学校的远程服务器上执行此操作的。请告诉我为什么即使安装成功也出现错误。我知道这与共享库有关,但安装程序识别了它们。

旁注:如果我不说“use 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 应该处理这个问题。

I am trying to get WWW::Mechanize to login to Yahoo using https; however, it requires the use of Crypt::SSLeay for sending over https.

Crypt::SSLeay installed succesfully, and openssl was already installed on the system.

However, it gives the error upon loading:



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.


The installation of Crypt::SSLeay was successful, and could recognize the installation of openssl (here):

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]

NOTE: recently installed Perl v5.10.1 using App::perlbrew, due to LWP::UserAgent's needing it. I installed Crypt::SSLeay using my new version of Perl.

I don't have root priveldiges, as I am doing this on a remote server at school. Please tell me why it's giving the error even though it installed succesfully. I know it has something to do with the shared libraries, but the installation recognized them.

SIDE NOTE: my script works fine if I don't say "use Crypt::SSLeay;" at the start, but it gives the error when I use https that it's not a supported protocol, and needs LWP::protocol::https installed. Installing that always fails.

EDIT: Thanks for your help, CJM. Apparently it was using the old version of Perl when I executed, but now I've fixed that.

It doesn't give that error anymore; however, it still says

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

I thought Crypt::SSLeay was supposed to take care of this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鲜血染红嫁衣 2024-11-15 02:00:34

如果您检查错误消息,您会注意到它提到了 5.10.1 和 5.8.0(在 Perl 库路径中)。这表明您正在尝试将针对某一版本的 Perl 构建的模块与另一版本一起使用。基于 XS 的 Perl 模块(即包含 C 代码的模块)在 Perl 的主要版本之间不具有二进制兼容性。

您似乎使用 Perl 5.10.1 安装了 Crypt::SSLeay,并尝试将其与 5.8.0 一起使用。那是行不通的。该安装仅使用 Perl 5.10.x。如果您还需要将其与 Perl 5.8.0 一起使用,请在不同的目录中安装另一个副本。

If you examine the error message, you'll notice it mentions both 5.10.1 and 5.8.0 (in the Perl library paths). This indicates that you're trying to use a module built for one version of Perl with a different version. XS-based Perl modules (i.e. ones that include C code) are not binary compatible between major releases of Perl.

It appears you installed Crypt::SSLeay using Perl 5.10.1, and are trying to use it with 5.8.0. That won't work. Use only Perl 5.10.x with that installation. If you need to use it with Perl 5.8.0 also, install another copy in a different directory.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文