Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save djsipe/30d971272c4a604078d813ffb1d0b4a6 to your computer and use it in GitHub Desktop.
Save djsipe/30d971272c4a604078d813ffb1d0b4a6 to your computer and use it in GitHub Desktop.

Assuming you are using the official PHP Docker image...

# ---------------------------------------------------------------
# PHP Extension: Gearman
# Download Gearman PECL extension for Gearman supporting PHP 7
RUN apt-get -y --allow-unauthenticated install \
    libgearman-dev
RUN cd /tmp \
    && git clone https://github.com/wcgallego/pecl-gearman.git \
    && cd pecl-gearman \
    && git checkout gearman-2.0.3 \
    && phpize \
    && ./configure \
    && make -j$(nproc) \
    && make install \
    && rm -r /tmp/pecl-gearman \
    && docker-php-ext-enable gearman
@ja-weber
Copy link

For php 7.4 this is not working. Only for php 7.3. Has someone handled to install it on php 7.4?

@mlocati
Copy link

mlocati commented Jan 17, 2021

I recently updated my install-php-extensions script; it now supports installing the gearman PHP extension (as well as 92 other PHP extensions) with a single line:

install-php-extensions gearman

More info here: https://github.com/mlocati/docker-php-extension-installer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment