Gearman is a machine that is used to delegate work to other machines, distributed calls that are better suited for a particular job, and concurrent tasks that load balance among multiple calls.
Preparing packages
Gearmand-1.1.12.tar.gz
gearman-1.1.1.tgz PHP extension
Installing Support components
Yum-y Install boost-devel* gperf* libevent-devel* libuuid-devel*
./configure
Make
Make install
Ldconfig
Installing Gearman
Tar XF gearmand-1.1.12.tar.gz
CD gearmand-1.1.12
./configure--with-php-config=/usr/local/php/bin/php-config
Make
Make install
Installing PHP Extensions
Tar XF gearman-1.1.1.tgz
CD gearman-1.1.1
/usr/local/php/bin/phpize--with-php-config=/usr/local/php/bin/php-config
./configure--with-php-config=/usr/local/php/bin/php-config
Make
Configure Gearman
cp/tools/gearman-1.1.1/modules/gearman.so/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226
Vi/usr/local/php/etc/php.ini
" /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226 " extension="gearman.so"
Service httpd Restart
Start using
Mkdir-p/usr/local/var/log/
Echo ' >/usr/local/var/log/gearmand.log
Gearmand-d
Ps-ef | grep Gearman
Root15045 1 0 +: -?xx:xx:xxGearmand-Droot15053 1 0 +:Wuyi?xx:xx:xxGearmand-Droot15056 112065 0 +: thepts/3 xx:xx:xx grepGearman
/usr/local/php/bin/php -c/usr/local/php/etc/php.ini client.php
/usr/local/php/bin/php -c/usr/local/php/etc/php.ini worker.php
attached: several code examples
Put the code in the Htdocs directory to access worker.php and client.php respectively
It can also be executed under the Linux command line ...
;
PHP Asynchronous Task Processing: Gearman