Bobby's Blog

A step by step guide on how to install gearman for PHP 7.x on a cPanel EA 4 server.

bobby-ileiv-gearman-php-install

Usually I would use pecl to install some additional PHP extensions on a cPanel server. This is a standard thing for all cPanel servers.

The syntax would be the following:

The same thing would go for your additional EA4 PHP versions, for example if you wanted to do that for PHP 5.5 you could use:

However pecl does not yet have the gearman packages for PHP 7.x. So in order to install the extension we need to compile it from source.

Here are all of the steps that you would need to take. I would be doing this for PHP 7.0, the same steps would be valid for PHP 7.1 (Just change all references for php70 to php71).

Before starting with the compilation process itslef, I would suggest installing the gearman devel package:

1. Create a temporary directory that would hold our source files:

2. As I’ve tested this, I would use this git repo to get the gearman source files from.

Pecl Gearman Git Repo

3. Just download the files as normal:

4. The access the folder containing the source files:

5. Then use the following command here:

6. If the gearman.so file has now been added to the modules folder you might have to do that manually:

7. Then we need to make PHP aware of the new extension by adding the following line to the correct php.ini file:

8. You might also want to install and start the gearmand service by running:

9. To test if it is all working as expected run:

This is pretty much it.


About the author

Bobby

Linux System Administrator