我尝试了几篇关于在Amazon Linux AMI上安装Gearman的文章。我执行了以下步骤:
cd /var/tmp
wget https://launchpad.net/gearmand/1.2/1.1.12/+download/gearmand-1.1.12.tar.gz
tar xvzf gearmand-1.1.12.tar.gz
yum install libevent-devel gcc-c++ boost-devel libuuid-devel memcached-devel gperf
./configure
sudo make
sudo make install
sudo ldconfig
当我运行命令gearmand时,我可以看到它正在运行
Gearman PHP库
sudo yum -y install php-pear
sudo pecl install gearman
我得到了以下信息
Build process completed successfully
Installing '/usr/lib64/php/modules/gearman.so'
install ok: channel://pecl.php.net/gearman-1.1.2
Extension gearman enabled in php.ini
当我运行php --ini
时,我得到
Warning: PHP Startup: Unable to load dynamic library './gearman.so' - ./gearman.so: cannot open shared object file: No such file or directory in Unknown on line 0
因此,我编辑了php。ini文件并添加了
extension='/usr/lib64/php/modules/gearman.so'
现在,重新启动apache后,我得到
Warning: PHP Startup: gearman: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20100525
These options need to match
这是相同的PHP Gearman安装,但是提到的解决方案不适合我。
php -v给出
PHP 5.4.13 (cli) (built: Mar 29 2013 20:29:42)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
我正在使用亚马逊Linux。
gearmand -V
给出
gearmand 1.1.12 - https://bugs.launchpad.net/gearmand
pear -V给出
PEAR Version: 1.9.5
PHP Version: 5.3.29
Zend Engine Version: 2.3.0
Running on: Linux ip-10-0-1-160 4.1.7-15.23.amzn1.x86_64 #1 SMP Mon Sep 14 23:20:33 UTC 2015 x86_64
pecl -V
给出
PEAR Version: 1.9.5
PHP Version: 5.3.29
Zend Engine Version: 2.3.0
Running on: Linux ip-10-0-1-160 4.1.7-15.23.amzn1.x86_64 #1 SMP Mon Sep 14 23:20:33 UTC 2015 x86_64
问题与pear
相同。我使用yum安装了它。所以,首先把它删除。
sudo yum -y remove php-pear
我这样安装了pear
wget http://pear.php.net/go-pear.phar
/usr/local/bin/php -q php-phar
现在pear -V
显示
PEAR Version: 1.10.1
PHP Version: 5.4.13
然后,直接
pecl install gearman
然后复制gearman。php。ini文件