Gearman-PHP extended source code compilation PS: Gearman-PHP extended source code compilation process
# Operating system of the current server environment: CentOS release 6.2PHP PHP 5.4.42
Gearmand Source Code Compilation. Gearman-PHP extension depends on this library
Because the extension depends on the libgearman library, and the libgearman Library is generated in the gearmand source code compilation, the source code first installs gearmand.
# Gearmand dependency package install yum install-y gcc-c ++ libevent-devel boost-devel gperf uuid libuuid-devel; # gearmand source code compile wget https://launchpad.net/gearmand/1.2/1.1.12/+download/gearmand-1.1.12.tar.gz;tar-zxvf gearmand-1.1.12.tar.gz; cd gearmand-1.1.12 ;. /configure -- prefix =/usr/local/gearmand; make & make install;
Gearman-PHP extension installation
PHP Gearman extension homepage
Wget http://pecl.php.net/get/gearman-1.1.2.tgz;tar zxvf gearman-1.1.2.tgz; cd gearman-1.1.2;/usr/local/php/bin/phpize ;. /configure -- with-php-config =/usr/local/php/bin/php-config -- with-gearman =/usr/local/gearmand; make & make install; # command summary: wget http://pecl.php.net/get/gearman-1.1.2.tgz;tar zxvf gearman-1.1.2.tgz; cd gearman-1.1.2;/usr/local/php/bin/phpize ;. /configure -- with-php-config =/usr/local/php/bin/php-config -- with-gearman =/usr/local/gearmand; make & make install;
Add the gearman. so module information to php. ini.
Vi/usr/local/php/etc/php. ini # Added extension_dir = '. /'-> extension_dir ='/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/'extension = gearman. so
Restart php and run the following command: php-m | grep 'gearman' to check whether the extension has been installed.