Skip to content

Instantly share code, notes, and snippets.

@ekojs
Last active March 17, 2020 13:02
Show Gist options
  • Save ekojs/79742de4ce8d7b0bad659aac6b2c96ff to your computer and use it in GitHub Desktop.
Save ekojs/79742de4ce8d7b0bad659aac6b2c96ff to your computer and use it in GitHub Desktop.
Install Gearman in Centos 7
#!/bin/sh
# Auto update
yum update
# Install the required packages
yum install libgearman-devel gcc
yum install gcc gcc-c++ make bison flex autoconf libtool memcached libevent libevent-devel uuidd libuuid-devel boost boost-devel libcurl-dev libcurl curl gperf
# 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
yum -y install php-fpm
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment