gearmand及gearman php扩展安装

这两天给也业务安装gearmand和gearman php扩展,折腾死,编译了无数个版本,/usr/local/php/bin/php -v检查扩展情况都是提示失败。

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/gearman.so' - /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/gearman.so: cannot open shared object file: No such file or directory in Unknown on line 0

以下参考张宴blog安装gearmand-0.9.tar.gz和

1.安装服务端gearmand

cd /tools/
wget http://pkgs.fedoraproject.org/repo/pkgs/gearmand/gearmand-0.9.tar.gz/8bdedc7809180f5f33ec123e2c47389e/gearmand-0.9.tar.gz
tar zxvf gearmand-0.9.tar.gz
cd gearmand-0.9
./configure --prefix=/usr/local/gearmand --with-libevent-prefix=/usr/local/
make && make install

卸载之前yum安装的版本(可省步骤)
rpm -qa|grep gearma
yum remove gearmand libgearman libgearman-devel

2.安装gearman扩展

wget http://pecl.php.net/get/gearman-0.5.0.tgz
tar zxvf gearman-0.5.0.tgz
cd gearman-0.5.0
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-gearman=/usr/local/gearmand/
make
make install
添加扩展 vim /usr/local/php/etc/php.ini
查看扩展安装是否成功 /usr/local/php/bin/php -v

重起php /usr/local/php/sbin/php-fpm restart

3.启动gearmand服务端

/usr/local/gearmand/sbin/gearmand -L 192.168.1.134 -p 4730 -u root -d


你可能感兴趣的:(安装,PHP扩展,gearmand)