Perl GD模块无法安装 –

前端之家收集整理的这篇文章主要介绍了Perl GD模块无法安装 –前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图找出为什么我不能在我的Debian 7服务器上安装GD perl模块.以下是我安装核心内容方法
sudo apt-get install libgd-gd2-perl

然后运行-MCPAN进行安装,我得到:

root@myserver:~# sudo perl -MCPAN -e 'install GD'
Going to read '/root/.cpan/Metadata'
  Database was generated on Sun,19 Jul 2015 21:41:02 GMT
Running install for module 'GD'
Running make for L/LD/LDS/GD-2.56.tar.gz
Checksum for /root/.cpan/sources/authors/id/L/LD/LDS/GD-2.56.tar.gz ok

  CPAN.pm: Going to build L/LD/LDS/GD-2.56.tar.gz

Configuring for libgd version 2.0.36.
Checking for stray libgd header files...none found.

Unknown option: installdirs
Usage: perl Build.PL [options]

Configure GD module.

 Options:
     -options       "JPEG,FT,PNG,GIF,XPM,ANIMGIF"   feature options,separated by commas
     -lib_gd_path   path            path to libgd
     -lib_ft_path   path            path to Freetype library
     -lib_png_path  path            path to libpng
     -lib_jpeg_path path            path to libjpeg
     -lib_xpm_path  path            path to libxpm
     -lib_zlib_path path            path to libpng
     -ignore_missing_gd             Ignore missing or old libgd installations and try to compile anyway

If no options are passed on the command line.  The program will
attempt to autoconfigure itself with the gdlib-config program (present
in GD versions 2.0.27 or later).  Otherwise it will prompt for these
values interactively.
Warning: No success on command[/usr/bin/perl Build.PL --installdirs site]
  LDS/GD-2.56.tar.gz
  /usr/bin/perl Build.PL --installdirs site -- NOT OK
Running Build test
  Make had some problems,won't test
Running Build install
  Make had some problems,won't install
Could not read Metadata file. Falling back to other methods to determine prerequisites

我已经完成了大量的谷歌搜索,但似乎没有什么能解决它.有什么建议么?

解决方法

你得到的错误
Unknown option: installdirs
Usage: perl Build.PL [options]

cpan期望Build.PL将其参数传递给Module :: Build,但GD有一个时髦的Build.PL.让我们“修理”它吧.

从临时目录执行以下命令:

wget http://search.cpan.org/CPAN/authors/id/L/LD/LDS/GD-2.56.tar.gz
  -or-
curl -L http://search.cpan.org/CPAN/authors/id/L/LD/LDS/GD-2.56.tar.gz >GD-2.56.tar.gz

tar xvzf GD-2.56.tar.gz
cd GD-2.56
perl -i~ -pE'say "Getopt::Long::Configure(qw( pass_through ));" if /GetOptions/;' Build.PL
/usr/bin/perl Build.PL --installdirs site
sudo ./Build.PL installdeps
./Build.PL make
./Build.PL test
sudo ./Build.PL install
原文链接:https://www.f2er.com/Perl/172883.html

猜你在找的Perl相关文章