【问题标题】:Error installing PECL extension KTaglib on ubuntu?在 ubuntu 上安装 PECL 扩展 KTaglib 时出错?
【发布时间】:2025-12-28 15:15:12
【问题描述】:

我无法在 Ubuntu 上安装 KTablib 文件,包在这里:http://pecl.php.net/package/ktaglib

这是我看到的错误:

    root@local:~# pear install http://taglib.github.io/releases/taglib-1.9.1.tar.gz
    downloading taglib-1.9.1.tar.gz ...
    Starting to download taglib-1.9.1.tar.gz (654,074 bytes)
    ..............done: 654,074 bytes
    could not extract the package.xml file from "/build/buildd/php5-5.5.9+dfsg/pear-build-download/taglib-1.9.1.tar.gz"
    Download of "http://taglib.github.io/releases/taglib-1.9.1.tar.gz" succeeded, but it is not a valid package archive
    Invalid or missing remote package file
    install failed
    root@local:~# sudo apt-get install libpcre3-dev
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following extra packages will be installed:
      libpcrecpp0
    The following NEW packages will be installed:
      libpcre3-dev libpcrecpp0
    0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded.
    Need to get 251 kB of archives.
    After this operation, 951 kB of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Get:1 http://mirror.rackspace.com/ubuntu/ trusty/main libpcrecpp0 amd64 1:8.31-2ubuntu2 [14.5 kB]
    Get:2 http://mirror.rackspace.com/ubuntu/ trusty/main libpcre3-dev amd64 1:8.31-2ubuntu2 [237 kB]
    Fetched 251 kB in 0s (5,499 kB/s)
    Selecting previously unselected package libpcrecpp0:amd64.
    (Reading database ... 61117 files and directories currently installed.)
    Preparing to unpack .../libpcrecpp0_1%3a8.31-2ubuntu2_amd64.deb ...
    Unpacking libpcrecpp0:amd64 (1:8.31-2ubuntu2) ...
    Selecting previously unselected package libpcre3-dev:amd64.
    Preparing to unpack .../libpcre3-dev_1%3a8.31-2ubuntu2_amd64.deb ...
    Unpacking libpcre3-dev:amd64 (1:8.31-2ubuntu2) ...
    Processing triggers for man-db (2.6.7.1-1) ...
    Setting up libpcrecpp0:amd64 (1:8.31-2ubuntu2) ...
    Setting up libpcre3-dev:amd64 (1:8.31-2ubuntu2) ...
    Processing triggers for libc-bin (2.19-0ubuntu6) ...
    root@local:~# pear install http://pecl.php.net/get/KTaglib-0.2.0.tgz
    downloading KTaglib-0.2.0.tgz ...
    Starting to download KTaglib-0.2.0.tgz (12,897 bytes)
    .....done: 12,897 bytes
    17 source files, building
    running: phpize
    Configuring for:
    PHP Api Version:         20121113
    Zend Module Api No:      20121212
    Zend Extension Api No:   220121212
    building in /tmp/pear/temp/pear-build-rootG9cBy9/KTaglib-0.2.0
    running: /tmp/pear/temp/KTaglib/configure
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for a sed that does not truncate output... /bin/sed
    checking for cc... cc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether cc accepts -g... yes
    checking for cc option to accept ISO C89... none needed
    checking how to run the C preprocessor... cc -E
    checking for icc... no
    checking for suncc... no
    checking whether cc understands -c and -o together... yes
    checking for system library directory... lib
    checking if compiler supports -R... no
    checking if compiler supports -Wl,-rpath,... yes
    checking build system type... x86_64-unknown-linux-gnu
    checking host system type... x86_64-unknown-linux-gnu
    checking target system type... x86_64-unknown-linux-gnu
    checking for PHP prefix... /usr
    checking for PHP includes... -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib
    checking for PHP extension directory... /usr/lib/php5/20121212
    checking for PHP installed headers prefix... /usr/include/php5
    checking if debug is enabled... no
    checking if zts is enabled... no
    checking for re2c... no
    configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
    checking for gawk... no
    checking for nawk... nawk
    checking if nawk is broken... no
    checking This extension requires the KDE TagLib Library version 1.4
              or above and a working pkg-config installation.... yes, shared
    checking for g++... g++
    checking whether we are using the GNU C++ compiler... yes
    checking whether g++ accepts -g... yes
    checking how to run the C++ preprocessor... g++ -E
    checking for pkg-config... /usr/bin/pkg-config
    configure: error: 'taglib' not known to pkg-config
    ERROR: `/tmp/pear/temp/KTaglib/configure' failed

我不知道如何解决这些给我带来问题的错误:

    configure: error: 'taglib' not known to pkg-config
    ERROR: `/tmp/pear/temp/KTaglib/configure' failed

感谢任何帮助。

【问题讨论】:

  • 我试图在 CentOS 上做同样的事情并得到同样的错误。我已经检查了运行 pkg-config --exists taglib 会生成一个 1 返回值,所以它认为它不存在,尽管它在那里。我不知道为什么会这样。

标签: php ubuntu ssh


【解决方案1】:

似乎编译的rrd 库(librrd.so, .la) 对链接器不可见。如果您手动安装了rrd 工具,请验证您的安装。当您通过 phpize 安装扩展时,您可以通过配置选项指定任何安装rrd 路径(--with-rrd 您可以通过configure --help 进行验证)。 我想phpize 是您的案例推荐的安装过程。

【讨论】:

  • 我很困惑。为什么 rrd 会导致 pkg-config 尽管安装了 taglib 却无法识别它的存在?