4

Description

Trying to install the laelaps/symfony-gearman-bundle via composer require laelaps/symfony-gearman-bundle with a few errors, and I'm having a hard time understanding what they mean.

Error

Problem 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].

I've already insalled gearman via apt-get install gearman-job-server I've searched around for a solution without much success.

Question

How do I correctly install the missing php ext gearman?

kemicofa ghost
  • 16,349
  • 8
  • 82
  • 131
  • Have you checked the extension is added correctly to `php.ini` and have you restarted Apache? `phpinfo() will show if the extension has installed correctly. – Egg Apr 05 '16 at 10:37

3 Answers3

4

I've already installed gearman via apt-get install gearman-job-server I've searched around for a solution without much success.

This is your issue. You haven't installed the php extension - you've just installed the program.

If you use the command apt-cache search gearman you can see all packages in aptitude relating to the keyword "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

If you look you can see that there's a PHP extension named php5-gearman. That's what this is what your error is referring to:

the requested PHP extension gearman is missing from your system.

So simply install php5-gearman and restart php/your webserver:

sudo apt-get install php5-gearman
sudo service php5-fpm restart # restart if you use php5-fpm
h2ooooooo
  • 39,111
  • 8
  • 68
  • 102
1

You need to install the PHP dependencies as follow:

sudo apt-get install libgearman-dev

Check this article for further detail based on your SO.

Probably you need to add the library on the php conf system as example:

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

Hope this help

Matteo
  • 37,680
  • 11
  • 100
  • 115
-1

For Ubuntu 16.04 Xenial, solution that worked for me was following these steps:

Install additional packages for compiling

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

Install from source

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

Verify if module is really installed

php -m | grep gearman

Delete installation files

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

rm /tmp/install/master.zip