Perl GD 模块不会安装 -

标签 perl gd cpan

我试图弄清楚为什么我无法在我的 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

关于Perl GD 模块不会安装 -,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31521570/

相关文章:

HTML::Entities 编码和单符号

Perl - 关于解引用的正确语法的两个问题

regex - 如何使用 Perl 验证包含平衡文本的数据?

php - 从 PHP 中的图像中裁剪空白

php - 调用未定义的函数imagewebp(Dockerfile,php,gd,webp)

perl - 如何使用 ActiveState Perl 在 Windows 上安装 Spreadsheet::WriteExcel?

git - mingw64 shell perl CPAN 不适用于任何模块

perl - 如何在 Perl 中覆盖诸如 `length` 之类的子例程?

perl - 需要带有 CentOS 和 perl 模块的 .ami 文件

php - 我在哪里可以找到 GD 兼容字体?