php - 在 Debian 6 上安装 Gearman PHP 扩展

标签 php linux debian gearman

我拼命想让 Gearman PHP 扩展在 Debian 6 上运行。

我有所有的二进制文件和源代码

root@debian:/tmp/pear/install# aptitude search gearman
i   gearman                                                             - A distributed job queue
i A gearman-job-server                                                  - Job server for the Gearman 
i   gearman-tools                                                       - Tools for the Gearman 
i   libgearman-dev                                                      - Development files for the 
i   libgearman4                                                         - Library providing Gearman

...但是当 PHP 扩展配置中有一些错误时,不允许我安装它

# /usr/local/pear/bin/pecl install gearman
downloading gearman-1.1.0.tgz ...
Starting to download gearman-1.1.0.tgz (30,488 bytes)
.........done: 30,488 bytes
3 source files, building
running: phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
building in /tmp/pear/install/pear-build-rootrDO8Ob/gearman-1.1.0
running: /tmp/pear/install/gearman/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/20090626
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 whether to enable gearman support... yes, shared
not found
configure: error: Please install libgearman
ERROR: `/tmp/pear/install/gearman/configure' failed

config.m4 中有几行有趣的内容

 for i in $PHP_GEARMAN /usr/local /usr /opt/local; do
    if test -r $i/include/libgearman-1.0/gearman.h; then
      GEARMAN_LIB_DIR=/usr/lib
      GEARMAN_INC_DIR=/usr/include/
      AC_MSG_RESULT([found in $i])
      break
    fi
  done

首先是对“libgearman-1.0”的引用(源代码中使用了相同的目录名称)。安装的包含改为/usr/include/libgearman。问题不大,我创建了一个链接

ln -s libgearman/ libgearman-1.0

同时以防万一,eddied GEARMAN_LIB_DIR 和 GEARMAN_INC_DIR 将其指向正确的目录。不幸的是,据我所知:

./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/20090626
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 whether to enable gearman support... yes, shared
found in /usr
checking for gearman_client_set_context in -lgearman... yes
checking for gearman_worker_set_server_option in -lgearman... no
configure: error: libgearman version 0.21 or later required

您知道在 Debian/Ubuntu 上安装此 PHP 扩展的最简单方法是什么吗?我在谷歌上找到了一些建议,但没有一个对我有用。

最佳答案

这不起作用的原因是,如错误消息所述,最新版本的 PHP 扩展需要 libgearman-1.0(这就是目录命名为 1.0 的原因)。您至少需要使用 wheezy(这是 debian 6/squeeze 之后的版本)才能获得 libgearman-1.0。

也可能是从源代码编译 libgearman 的解决方案,然后使用 checkinstall 创建一个您之后安装的 debian 包,或者使用 https:/提供的 gearman developer ppa/launchpad.net/~gearman-developers/+archive/ppa。我们在各种发行版(包括 Debian、Ubuntu、RHEL4 和 SL6)上构建了 libgearman、gearmand 和 PHP 扩展,并使用 checkinstall 来获得合适的可用包。

关于php - 在 Debian 6 上安装 Gearman PHP 扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13312207/

相关文章:

c++ - Qt debian/ubuntu : Can't compile, 错误:找不到-lGL

php - 什么正在预热已清除的缓存?

php - 为什么我在 Symfony 1.2 上用 Doctrine 保存一个 "validator failed"?

linux - 如何在 shell 中执行没有 .sh 扩展名的文件

Linux Centos 7,如何安装siunix LaTeX包?

python - Nagios/Centreon 错误 : Return code 127 is out of bounds : Plugin may be missing

c++ - 包含预编译二进制文件与手动编译二进制文件不同的头文件的正确方法

php - 永久重定向 "sub-routes"

php - FFMPEG - 用于动画的 Palettegen 不起作用

linux - dos2unix:找到二进制符号,跳过二进制文件