4

私は必死になってGearmanPHP拡張機能をDebian6で動作させようとしています。

私はすべてのバイナリとソースを持っています

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拡張機能のconfingにバグがあり、インストールできない場合

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

また、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

このPHP拡張機能をDebian/Ubuntuにインストールする最も簡単な方法を知っていますか?私はグーグルでいくつかの提案を見つけましたが、それらのどれも私のために働きませんでした。

4

3 に答える 3

8

これが機能しない理由は、エラーメッセージに示されているように、最新バージョンのPHP拡張機能にはlibgearman-1.0が必要であるためです(これがディレクトリの名前が1.0である理由です)。libgearman-1.0を入手するには、少なくともwheezy(debian 6 / squeeze以降のバージョン)を使用している必要があります。

また、ソースからlibgearmanをコンパイルし、checkinstall後でインストールするdebianパッケージを作成するために使用するか、で入手可能なギアマン開発者ppaを使用することも解決策になる可能性がありますhttps://launchpad.net/~gearman-developers/+archive/ppa。libgearman、gearmand、およびPHP拡張機能をさまざまなディストリビューション(Debian、Ubuntu、RHEL4、SL6を含む)で構築し、checkinstallを使用して適切なパッケージを利用できるようにしました。

于 2012-11-30T21:59:42.937 に答える
1
sudo apt-get install make gcc g++
sudo apt-get install libboost-thread-dev libboost-program-options-dev libevent-dev uuid-dev libpq-dev libcloog-ppl0 libcurl4-gnutls-dev
sudo apt-get install libmemcached-dev libmariadbclient-dev libsqlite3-dev # option

wget https://launchpad.net/gearmand/1.2/1.1.12/+download/gearmand-1.1.12.tar.gz
tar xvfz gearmand-1.1.12.tar.gz
cd gearmand-1.1.12
./configure
make
sudo make install

sudo useradd -M gearman -s /sbin/nologin -r
sudo mkdir /var/run/gearman /var/log/gearman-job-server
sudo touch /var/log/gearman-job-server/gearman.log
sudo chown gearman:gearman /var/run/gearman /var/log/gearman-job-server

sudo vi /etc/init.d/gearman-job-server

資力

于 2015-06-02T09:22:22.653 に答える
0

古いバージョンのgearman(0.8.3)をインストールするための完全なインストール手順は、ここにあります。これにより、問題が解決する可能性があります http://blog.andyburton.co.uk/index.php/2012-12/gearman-0-41 -with-mysql-persistent-storage-and-php-pecl-0-8-3-with-gearmanmanager-on-ubuntu-12-04 /

于 2014-01-16T20:55:34.637 に答える