Created
December 12, 2015 17:42
-
-
Save hieubuiduc/105989131e1192e0d680 to your computer and use it in GitHub Desktop.
Install Gearman PHP extension on CentOS 6,7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you very much 👍