PS:Gearman-PHP擴充源碼編譯過程
#當前伺服器環境作業系統:CentOS release 6.2PHP版本 PHP 5.4.42
gearmand源碼編譯,Gearman-PHP擴充依賴該庫
由於擴充依賴libgearman庫,並且libgearman庫在gearmand源碼編譯中產生,所以先源碼裝gearmand
#gearmand依賴包安裝yum install -y gcc gcc-c++ libevent libevent-devel boost boost-devel gperf uuid libuuid libuuid-devel;#gearmand源碼編譯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擴充安裝
PHP Gearman擴充首頁
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;#命令匯總: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;
將gearman.so模組資訊加入php.ini
vi /usr/local/php/etc/php.ini#增加extension_dir = './' -> extension_dir = '/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/'extension=gearman.so
重啟php,通過命令:php -m | grep ‘gearman’ 查詢擴充是否已經安裝