Skip to content

Instantly share code, notes, and snippets.

@hieubuiduc
Created December 12, 2015 17:42
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save hieubuiduc/105989131e1192e0d680 to your computer and use it in GitHub Desktop.
Save hieubuiduc/105989131e1192e0d680 to your computer and use it in GitHub Desktop.
Install Gearman PHP extension on CentOS 6,7
#!/bin/sh
# Auto update
yum update
# Install the required packages
yum install libgearman-devel gcc
# Install php
yum -y install php php-pear php-mysql php-mcrypt php-mbstring
# Install php-devel dependency via yum
yum -y install php-devel
# Get the latest stable build from Gearman PECL extension page.
# The current stable release is version 1.1.2
wget http://pecl.php.net/get/gearman-1.1.2.tgz
tar -xzvf gearman-1.1.2.tgz
cd gearman-1.1.2
# Now phpize and complie it:
phpize
./configure
make
make install
# You will finally see something like this:
# Installing shared extensions: /usr/lib64/php/modules/
# Update PHP.INI file:
# The following line will need to be added to all php.ini files, usually located in /etc/php*.
# extension=”gearman.so”
# Or create the file configuration file
touch /etc/php.d/gearman.ini
echo 'extension=gearman.so' >> /etc/php.d/gearman.ini
# Verify the installation by viewing a phpinfo page or just via the command line.
# You will see "gearman" in the list
php -m
# Restart php
# service php-fpm restart
# Now restart the web server and you’re good to go:
# service nginx restart
@visonforcoding
Copy link

when yum install libgearman-devel , the result will show No package libgearman-devel available. can you tell me your yum source address?

@DavidWang666
Copy link

the gearman support php7?

@relipse
Copy link

relipse commented Apr 6, 2020

What about sudo yum install php71-php-pecl-gearman

@sumonst21
Copy link

sumonst21 commented Aug 11, 2020

What about sudo yum install php71-php-pecl-gearman

Thank you very much 👍

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