2012-11-09 4 views
4

내가 가진 모든 바이너리와 소스데비안 6 나는 필사적으로 데비안 6</p> <p>에서 작업 Gearman을 PHP 확장을 얻으려고

[email protected]:/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 

...하지만에 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 파일이 몇 가지 흥미로운 라인하지 않는 PHP 확장 confing에 몇 가지 버그가 있습니다

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"에 대한 참조가 있습니다 (소스 코드에서 동일한 dir 이름이 사용됩니다). 설치된 인클루드는 대신/usr/include/libgearman을 사용했습니다. 아니 큰 문제 나는

ln -s libgearman/ libgearman-1.0 

은 또한 단지의 경우 올바른 디렉토리를 가리 키도록 GEARMAN_LIB_DIR 및 GEARMAN_INC_DIR을 eddied 링크를 만들었습니다. 불행하게도이 그대로 지금까지 내가 얻을 :

./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 확장을 설치하는 가장 쉬운 방법은 무엇인지 아십니까? 나는 구글에 대한 몇 가지 명제를 찾았지만 그들 중 누구도 나를 위해 일하지 않았다.

답변

7

이것이 작동하지 않는 이유는 오류 메시지가 말하는 바와 같이 PHP 확장의 최신 버전에는 libgearman-1.0이 필요하기 때문입니다 (이것이 디렉토리 이름이 1.0 인 이유입니다). libgearman-1.0을 얻으려면 적어도 wheezy (debian 6/squeeze 이후 버전)에 있어야합니다.

libgearman을 소스에서 컴파일 한 다음 나중에 checkinstall을 사용하여 설치하는 데비안 패키지를 만들거나 https://launchpad.net/~gearman-developers/+archive/ppa에있는 gearman 개발자 ppa를 사용할 수도 있습니다. 다양한 배포판 (Debian, Ubuntu, RHEL4 및 SL6 포함)에 libgearman, gearmand 및 PHP 확장을 구축했으며 checkinstall을 사용하여 적절한 패키지를 제공합니다.

+0

시간과 답변에 감사드립니다. –

0
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 

자원