我的服务器使用的是 ius 的 php5.5 ,如果你使用其他源和版本,请自行替换部分包名
1. 安装 epel 和 ius 源
1 2
| yum install http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/epel-release-6-5.noarch.rpm yum install http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/ius-release-1.0-11.ius.centos6.noarch.rpm
|
2. 安装 gearman ,用于运行 gearman 服务
3. 安装 libgearman 和 libgearman-devel ,用于编译 php 扩展
1
| yum install libgearman libgearman-devel
|
4. 安装 pecl 和其他依赖
1
| yum install php-pear php55u-devel
|
5. 安装 php 扩展
6. 修改配置文件 /etc/php.ini 增加 extension=gearman.so
7.验证安装结果
1 2
| $ php -m | grep gearman gearman
|