在Debian 6上安装Gearman PHP扩展 [英] Installing Gearman PHP extension on Debian 6

查看:143
本文介绍了在Debian 6上安装Gearman PHP扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我拼命地试图让Gearman PHP扩展工作在Debian 6上。



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

  root @ debian:/ tmp / pear / install#aptitude search gearman 
i gearman - 分布式作业队列
i A齿轮工作服务器 - Gearman的工作服务器
i gearman工具 - Gearman的工具
i libgearman-dev -
i libgearman4的开发文件 - 提供Gearman的图书馆

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

 #/ usr / local / pear / bin / pecl install gearman 
下载gearman-1.1.0.tgz ...
从下到上负载齿轮 - 1.1.0.tgz(30,488字节)
.........完成:30,488字节
3源文件,构建
运行:phpize
配置for:
PHP Api版本:20090626
Zend模块Api编号:20090626
Zend扩展Api号码:220090626
建在/ tmp / pear / install / pear-build-rootrDO8Ob / gearman-1.1.0
运行:/ tmp / pear / install / gearman / configure
检查处理长行的grep和-e ... / bin / grep
检查egrep。 .. / bin / grep -E
检查不截断输出的sed ... / bin / sed
检查cc ... cc
检查C编译器是否工作。 ..是
检查C编译器默认输出文件名... a.out
检查可执行文件的后缀...
检查是否我们是交叉编译...否
检查对象文件的后缀... o
检查我们是否使用GNU C编译器...是
检查cc是否接受-g ...是
检查cc选项接受ISO C89 ...无需
检查如何运行C预处理程序... cc -E
检查icc ...否
检查suncc ...否
检查cc是否理解-c和-o together ...是
检查系统库目录... lib
检查编译器是否支持-R ...否
检查编译器是否支持-Wl,-rpath,..是
检查构建系统类型... x86_64-unknown-linux-gnu
检查主机系统类型... x86_64-unknown-linux-gnu
检查目标系统类型... x86_64 -unknown-linux-gnu
检查PHP前缀... / usr
检查PHP包括... -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
检查PHP扩展目录... / usr / lib / php5 / 20090626
检查PHP安装的头前缀... / usr / include / php5
检查是否启用调试...否
检查是否zts启用... no
检查re2c ... no
配置:警告:你wi如果要重新生成PHP解析器,则需要re2c 0.13.4或更高版本。
检查gawk ...否
检查nawk ... nawk
检查nawk是否坏了...否
检查是否启用齿轮箱支持...是的,共享
未找到
配置:错误:请安装libgearman
错误:`/ tmp / pear / install / gearman / configure'失败
pre>

config.m4有一些有趣的行

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

首先有一个对libgearman-1.0的引用(使用相同的目录名源代码)。已安装的包已经转到/ usr / include / libgearman。不是一个大问题我创建了一个链接

  ln -s libgearman / libgearman-1.0 

此外,只有在eddied GEARMAN_LIB_DIR和GEARMAN_INC_DIR才能将其指向正确的目录。不幸的是,这是我到目前为止:

  ./ configure 
检查处理长行的grep和-e。 .. / bin / grep
检查egrep ... / bin / grep -E
检查不截断输出的sed ... / bin / sed
检查cc。 .. cc
检查C编译器是否工作...是
检查C编译器默认输出文件名... a.out
检查可执行文件的后缀...
检查我们是否是交叉编译...否
检查对象文件的后缀... o
检查我们是否使用GNU C编译器...是
检查cc是否接受-g ...是
检查cc选项以接受ISO C89 ...无需
检查如何运行C预处理程序... cc -E
检查icc ...否
检查suncc ...否
检查cc是否理解-c和-o在一起...是
检查系统库目录... lib
检查编译器支持-R ... no
检查编译器是否支持-Wl, -rpath,...是
检查构建系统类型... x86_64-unknown-linux-gnu
检查主机系统类型... x86_64-unknown-linux-gnu
检查目标系统键入... x86_64-unknown-linux-gnu
检查PHP前缀... / usr
检查PHP包括... -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
检查PHP扩展目录... / usr / lib / php5 / 20090626
检查PHP安装的头前缀... / usr / include / php5
检查是否启用调试...
检查是否启用了zts ... no
检查re2c ... no
configure:警告:如果要重新生成PHP解析器,则需要re2c 0.13.4或更高版本。
检查gawk ...否
检查nawk ... nawk
检查nawk是否坏了...否
检查是否启用齿轮箱支持...是的,共享
发现在/ usr
检查齿轮箱中的gearman_client_set_context ...是
检查lgearman中的gearman_worker_set_server_option ...否
配置:错误:libgearman版本0.21或更高版本需要

你知道在Debian / Ubuntu上安装这个PHP扩展最简单的方法是什么?我在google上找到了一些命题,但没有为我工作。

解决方案

这不行的原因是错误消息说,最新版本的PHP扩展需要libgearman-1.0(这就是为什么目录命名为1.0)。你需要至少在wheezy(这是debian 6 / squeeze之后的版本)获得libgearman-1.0。



它也可能是一个解决方案来编译libgearman从源代码,然后使用 checkinstall 创建一个你以后安装的debian软件包,或使用在$ code> https://启动板.net /〜gearman-developers / + archive / ppa 。我们已经在各种发行版(包括Debian,Ubuntu,RHEL4和SL6)上构建了libgearman,gearmand和PHP扩展,并使用checkinstall来获取适当的包。


I'm desperately trying to get the Gearman PHP extension working on a Debian 6.

I have all the binaries and sources

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

...but when there are some bugs in the PHP extension confing which don't let me install it

# /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

The config.m4 has few interesting lines

 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

First of all there is a reference to "libgearman-1.0" (the same dir name is used in the source code). Installed includes went to /usr/include/libgearman instead. Not a big problem I created a link

ln -s libgearman/ libgearman-1.0

Also just in case eddied GEARMAN_LIB_DIR and GEARMAN_INC_DIR to point it to the right directories. Unfortunately this is as far I get:

./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

Do you know what is the easiest way to install this PHP extension on Debian / Ubuntu? I found some propositions on google but non of them worked for me.

解决方案

The reason that this doesn't work is that as the error message says, the most recent version of the PHP extension requires libgearman-1.0 (which is why the directory is named 1.0). You'll need to be at least on wheezy (which is the version after debian 6 / squeeze) to get libgearman-1.0.

It might also be a solution to compile libgearman from source, and then use checkinstall to create a debian package that you install afterwards, or use the gearman developer ppa available at https://launchpad.net/~gearman-developers/+archive/ppa. We've built libgearman, gearmand and the PHP extension on a wide variety of distributions (including Debian, Ubuntu, RHEL4 and SL6) and used checkinstall to get a proper package available.

这篇关于在Debian 6上安装Gearman PHP扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆