简体   繁体   English

无法使用CPAN安装Perl模块(带有XAMPP的Windows XP Server)

[英]Unable To Install Perl Modules Using CPAN (Windows XP Server with XAMPP)

I currently have a Windows XP Pro SP3 server with XAMPP. 我目前有一个带有XAMPP的Windows XP Pro SP3服务器。 I downloaded the Perl add-on for XAMPP earlier today, and it installed without a problem. 我今天早些时候下载了XAMPP的Perl插件,并且安装没有问题。 After the install, I was able to go to .pl files on my server using a browser and they executed properly. 安装后,我能够使用浏览器转到服务器上的.pl文件,并且它们可以正确执行。 I am trying to now install some Perl modules using CPAN, and I get a few error messages along the way, and the modules do not install. 我现在正在尝试使用CPAN安装一些Perl模块,并且在此过程中收到一些错误消息,并且这些模块无法安装。 I am unfamiliar with Perl and would be grateful for any help. 我不熟悉Perl,不胜感激。 Below is what happens when I try to install a module: 以下是我尝试安装模块时发生的情况:

cpan[4]> install Task::Kensho
Running install for module 'Task::Kensho'
Running make for A/AP/APEIRON/Task-Kensho-0.31.tar.gz
CPAN: LWP::UserAgent loaded ok (v5.817)

I would like to connect to one of the following sites to get 'authors/id/A/AP/AP
EIRON/Task-Kensho-0.31.tar.gz':

 http://www.perl.org/CPAN/
 ftp://ftp.perl.org/pub/CPAN/

Is it OK to try to connect to the Internet? [yes] yes
Fetching with LWP:
  http://www.perl.org/CPAN/authors/id/A/AP/APEIRON/Task-Kensho-0.31.tar.gz
CPAN: Digest::SHA loaded ok (v5.45)
Fetching with LWP:
  http://www.perl.org/CPAN/authors/id/A/AP/APEIRON/CHECKSUMS
Checksum for \.cpan\sources\authors\id\A\AP\APEIRON\Task-Kensho-0.31.tar.gz ok
Scanning cache \.cpan\build for sizes
............................................................................DONE

The system cannot find the path specified.
Uncompressed \.cpan\sources\authors\id\A\AP\APEIRON\Task-Kensho-0.31.tar.gz succ
essfully
Using Tar:"C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\bin\tar.EXE" xvf "
Task-Kensho-0.31.tar":
The system cannot find the path specified.
Couldn't untar Task-Kensho-0.31.tar
CPAN: File::Temp loaded ok (v0.18)
Package seems to come without Makefile.PL.
  (The test -f "\.cpan\build\APEIRON-zQFric\Makefile.PL" returned false.)
  Writing one on our own (setting NAME to TaskKensho)
  Had problems unarchiving. Please build manually
Running make test
  Make had some problems, won't test
Running make install
  Make had some problems, won't install
Failed during this command:
 APEIRON/Task-Kensho-0.31.tar.gz              : unwrapped NO -- untar failed

This particular line: 此特定行:

Using Tar:"C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\bin\tar.EXE" xvf "

Is referencing a file and directory that I do not have on my system. 正在引用我的系统上没有的文件和目录。 I am not sure of the significance of that, but I thought I would point it out. 我不确定这样做的重要性,但我想指出这一点。

Any help is greatly appreciated! 任何帮助是极大的赞赏!

Update: @daxim , Thank you for the suggestion. 更新:@daxim,谢谢您的建议。 I installed Strawberry Perl and was able to install all required modules for the script I am trying to run using cpan install [module name]. 我安装了Strawberry Perl,并能够使用cpan install [module name]安装要运行的脚本的所有必需模块。 However, when I go to the script using a web browser, it does not compile and I am getting this in the Apache error log: 但是,当我使用Web浏览器转到脚本时,该脚本无法编译,并且在Apache错误日志中得到了该脚本:

[Sun Jan 08 13:03:15 2012] [error] [client 192.168.1.1] Can't load 'C:/strawberry/perl/site/lib/auto/XML/LibXML/LibXML.dll' for module XML::LibXML: load_file:The specified module could not be found at C:/strawberry/perl/lib/DynaLoader.pm line 200.\r
[Sun Jan 08 13:03:15 2012] [error] [client 192.168.1.1]  at C:/strawberry/perl/site/lib/XML/LibXML.pm line 154\r
[Sun Jan 08 13:03:15 2012] [error] [client 192.168.1.1] BEGIN failed--compilation aborted at C:/strawberry/perl/site/lib/XML/LibXML.pm line 154.\r
[Sun Jan 08 13:03:15 2012] [error] [client 192.168.1.1] Compilation failed in require at C:/strawberry/perl/site/lib/XML/LibXML/SAX.pm line 17.\r
[Sun Jan 08 13:03:15 2012] [error] [client 192.168.1.1] BEGIN failed--compilation aborted at C:/strawberry/perl/site/lib/XML/LibXML/SAX.pm line 17.\r
[Sun Jan 08 13:03:15 2012] [error] [client 192.168.1.1] Compilation failed in require at (eval 27) line 1.\r

I did install XML::LibXML as well as other required modules. 我确实安装了XML :: LibXML以及其他必需的模块。 Thanks again for any help! 再次感谢任何帮助!

I struggled with this for 2 days at work. 我为此工作了2天。

The issues is actually the global path for tar (and other Unix based programs) is incorrectly set. 问题实际上是tar(和其他基于Unix的程序)的全局路径设置不正确。 This happens if you have something like Git or Cygwin installed before Strawberry Perl, because they have Perl in them and it causes this issue I think. 如果在Strawberry Perl之前安装了Git或Cygwin之类的东西,就会发生这种情况,因为它们中包含Perl,这会导致这个问题。

To diagnose 诊断

Run cpan -J 运行cpan -J

Check if tar is set to an incorrect path /usr/bin/tar 检查tar是否设置为错误的路径/usr/bin/tar

If it is... 如果是...

Solution

In the commandline: 在命令行中:

perl -MCPAN -e shell

o conf init /tar/

From there enter the correct FULL path to either tar program in Git or Cygwin: 从那里输入到Git或Cygwin中tar程序的正确FULL路径:

C:\\\\cygwin64\\\\bin\\tar.exe

After that enter no when it ask if you want to use the external command instead of the build in Perl module. 之后,当询问您是否要使用外部命令而不是Perl内置模块时,请输入no

I am also struggling with the same error message from Strawberry Perl. 我也在Strawberry Perl中遇到同样的错误消息。

Can't load 'C:/strawberry/perl/site/lib/auto/XML/LibXML/LibXML.dll' 无法加载'C:/strawberry/perl/site/lib/auto/XML/LibXML/LibXML.dll'

I am seeing this error for XML::LibXML only. 我仅针对XML :: LibXML看到此错误。 Maybe there is some issue with version of DLL packaged with XML::LibXML for Strawberry Perl but I am not sure. 草莓Perl的XML :: LibXML打包的DLL版本可能存在问题,但我不确定。

I finally installed Activestate Perl and used the PPM tool that comes with Perl to install missing packages and everything went fine. 我终于安装了Activestate Perl,并使用了Perl随附的PPM工具来安装缺少的软件包,一切正常。 You can also try PPM GUI in Windows: 您也可以在Windows中尝试PPM GUI:

Start Menu → All Programs → ActivePerl 5.14.2 Build 1402 → Perl Package Manager. 开始菜单→所有程序→ActivePerl 5.14.2 Build 1402→Perl软件包管理器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM