How to install gearman in a plesk php environment in centos.


Installing gearman in a plesk/pecl environment is easy.

Install gearman

# yum install gearmand

Install some libraries

Some libraries are required for building the pecl extension for gearman.

[root@h01pl 5.4]# yum install libgearman-devel plesk-php54-devel gcc-c++

Find the path to your php version

In my case (php 5.4) it isĀ /opt/plesk/php/5.4/

[root@h01pl bin]# pwd

Build the gearman pecl extension

[root@h01pl bin]# ./pecl install gearman
Installing '/opt/plesk/php/5.4/lib64/php/modules/'
install ok: channel://
configuration option "php_ini" is not set to php.ini location
You should add "" to php.ini

Enabling the gearman extension in php.ini

[root@h01pl bin]# cd ../etc/php.d
[root@h01pl php.d]# echo '' > 100-gearman.ini

Verify that gearman is installed correctly

[root@h01pl php.d]# cd ../../bin
[root@h01pl bin]# ./php -ini | grep gearman
gearman support => enabled
libgearman version > 1.1.8

Start the gearmand service

[root@h01pl bin]# service gearmand start

Restart the http server

[root@h01pl bin]# service httpd restart

That’s it! You’re done.