您的系统中缺少gearman

时间:2016-04-05 10:34:41

标签: php composer-php symfony

描述

尝试通过composer require laelaps/symfony-gearman-bundle安装laelaps/symfony-gearman-bundle但有一些错误,我很难理解他们的意思。

错误

  

问题1

- laelaps/symfony-gearman-bundle 1.1.x-dev requires ext-gearman * -> the requested PHP extension gearman is missing from your system.
- laelaps/symfony-gearman-bundle 1.x-dev requires ext-gearman * -> the requested PHP extension gearman is missing from your system.
- laelaps/symfony-gearman-bundle 1.0.0 requires ext-gearman * -> the requested PHP extension gearman is missing from your system.
- Installation request for laelaps/symfony-gearman-bundle 1.*@dev -> satisfiable by laelaps/symfony-gearman-bundle[1.0.0, 1.x-dev, 1.1.x-dev].

我已经通过apt-get install gearman-job-server确认了齿轮手 我一直在寻找一个没有太大成功的解决方案。

问题

如何正确安装缺少的php ext gearman?

3 个答案:

答案 0 :(得分:4)

  

我已经通过apt-get install gearman-job-server安装了gearman   我一直在寻找一个没有太大成功的解决方案。

这是你的问题。您尚未安装 php 扩展程序 - 您刚刚安装了该程序。

如果您使用命令apt-cache search gearman,您可以在aptitude中查看与关键字“gearman”相关的所有包:

aj@dev ~ $ apt-cache search gearman
drizzle-plugin-gearman-udf - Gearman User Defined Functions for Drizzle
drizzle-plugin-logging-gearman - Gearman Logging for Drizzle
gearman - Distributed job queue
gearman-job-server - Job server for the Gearman distributed job queue
gearman-server - Gearman distributed job server and Perl interface
gearman-tools - Tools for the Gearman distributed job queue
libgearman-client-async-perl - asynchronous client for the Gearman distributed j                                                                                                                                      ob system
libgearman-client-perl - client for the Gearman distributed job system
libgearman-dbg - transitional dummy package
libgearman-dev - Development files for the Gearman Library
libgearman-doc - API Documentation for the Gearman Library
libgearman7 - Library providing Gearman client and worker functions
libgearman7-dbg - Debug symbols for the Gearman Client Library
mod-gearman-doc - Documentation and examples for Mod-Gearman
mod-gearman-module - Nagios/Icinga event broker module for Mod-Gearman
mod-gearman-tools - Tools for mod-gearman
mod-gearman-worker - Worker agent for Mod-Gearman
pandora-build - autotools made better, faster stronger

php5-gearman - PHP wrapper to libgearman
^^^^^^^^^^^^

pnp4nagios-bin - Nagios addon to create graphs from performance data (binaries)
python-gear - Pure Python Async Gear Protocol Library
python-gearman - Python interface to the Gearman system
python-gearman.libgearman - Python wrapper of libgearman
python3-gearman.libgearman - Python 3 wrapper of libgearman

如果你看,你可以看到有一个名为php5-gearman的PHP 扩展名。这就是你的错误所指的:

  

系统中缺少所请求的 PHP扩展装备

所以只需安装php5-gearman并重新启动php /您的网络服务器:

sudo apt-get install php5-gearman
sudo service php5-fpm restart # restart if you use php5-fpm

答案 1 :(得分:1)

您需要安装PHP依赖项,如下所示:

sudo apt-get install libgearman-dev

根据您的搜索结果查看this article以获取更多详细信息。

可能你需要在php conf系统上添加库,例如:

echo 'extension = gearman.so' > /usr/local/etc/php/conf.d/gearman.ini

希望这个帮助

答案 2 :(得分:-1)

对于Ubuntu 16.04 Xenial,适用于我的解决方案遵循以下步骤:

安装其他软件包进行编译

apt-get -y install wget unzip re2c libgearman-dev

从源安装

mkdir -p /tmp/install

cd /tmp/install

wget https://github.com/wcgallego/pecl-gearman/archive/master.zip

unzip master.zip

cd pecl-gearman-master

phpize

./configure

make install

echo "extension=gearman.so" > /etc/php/7.0/mods-available/gearman.ini

phpenmod -v ALL -s ALL gearman

验证模块是否确实安装

php -m | grep gearman

删除安装文件

rm -rf /tmp/install/pecl-gearman-master

rm /tmp/install/master.zip