{"id":1593,"date":"2022-01-23T22:38:03","date_gmt":"2022-01-23T14:38:03","guid":{"rendered":"https:\/\/www.siediyer.cn\/?p=1593"},"modified":"2022-01-23T22:38:03","modified_gmt":"2022-01-23T14:38:03","slug":"centos7%e5%ae%89%e8%a3%85gearman%e5%92%8cphp%e6%89%a9%e5%b1%95","status":"publish","type":"post","link":"https:\/\/www.siediyer.cn\/?p=1593","title":{"rendered":"Centos7\u5b89\u88c5gearman\u548cphp\u6269\u5c55"},"content":{"rendered":"<h2>gearman\u6240\u9700\u8981\u7684\u4f9d\u8d56<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">yum install \\\r\n   vim \\\r\n   git \\\r\n   gcc \\\r\n   gcc-c++ \\\r\n   wget \\\r\n   make \\\r\n   gperf \\\r\n   automake \\\r\n   autoconf \\\r\n   boost-devel \\\r\n   libuuid-devel \\\r\n   libevent-devel \\\r\n   -y \\<\/pre>\n<h2>\u5b89\u88c5gearmand<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/\/ wget https:\/\/launchpad.net\/gearmand\/1.2\/1.1.6\/+download\/gearmand-1.1.6.tar.gz\r\ncd \/root\r\nwget https:\/\/github.com\/gearman\/gearmand\/releases\/download\/1.1.17\/gearmand-1.1.17.tar.gz\r\ntar -zxvf gearmand-1.1.17.tar.gz\r\ncd gearmand-1.1.17\r\n.\/configure \\\r\n--prefix=\/usr\/local\/gearman\/ \\\r\n--disable-libpq \\\r\n--disable-hiredis \\\r\n--disable-libdrizzle \\\r\n--disable-silent-rules \\\r\n--disable-libtool-lock \\\r\n--disable-libmemcached \\\r\n--disable-option-checking \\\r\n--disable-libtokyocabinet \\\r\n--disable-dependency-tracking \\\r\nmake\r\nmake install<\/pre>\n<h2>\u521b\u5efagearman\u7528\u6237<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">useradd -s \/sbin\/nologin -M gearman\r\nmkdir \/usr\/local\/gearman\/var\/\r\nmkdir \/usr\/local\/gearman\/var\/log\/\r\nchown -R gearman:gearman \/usr\/local\/gearman\/<\/pre>\n<p>\u542f\u52a8gearman\u5e76\u8bbe\u7f6e\u5f00\u673a\u542f\u52a8<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"># \u8fdb\u5165\u5355\u5143\u6587\u4ef6\u76ee\u5f55\r\ncd \/etc\/systemd\/system\r\n# \u521b\u5efaredis\u5355\u5143\u6587\u4ef6,\u683c\u5f0f\u4e3a: [\u5355\u5143\u6587\u4ef6\u540d].[\u5355\u5143\u6587\u4ef6\u7c7b\u578b]\r\nvim gearman.service\r\n[Unit]\r\nDescription=Start gearman on boot.\r\nAfter=default.target network.target\r\n[Service]\r\nUser=gearman\r\nGroup=gearman\r\nType=forking\r\nPIDFile=\/usr\/local\/gearman\/var\/log\/gearmand.pid\r\nExecStart=\/usr\/local\/gearman\/sbin\/gearmand --log-file=\/usr\/local\/gearman\/var\/log\/gearmand.log --pid-file=\/usr\/local\/gearman\/var\/log\/gearmand.pid -d\r\nExecReload=\/bin\/kill -s HUP $MAINPID\r\nExecStop=\/bin\/kill -s QUIT $MAINPID\r\nPrivateTmp=false\r\nRestart=always\r\n[Install]\r\nWantedBy=multi-user.target<\/pre>\n<p>ESC<\/p>\n<p>:wq<\/p>\n<h2>\u4fee\u6539\u6587\u4ef6\u6743\u9650\u4e3a\u53ea\u6709root\u7528\u6237\u53ef\u4ee5\u7f16\u8f91\u8be5\u6587\u4ef6<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">chown -R root:root \/etc\/systemd\/system\/gearman.service\r\nchmod -R 644 \/etc\/systemd\/system\/gearman.service<\/pre>\n<h2>\u66f4\u65b0systemd<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">systemctl daemon-reload\r\nsystemctl enable gearman\r\nsystemctl start gearman<\/pre>\n<h2>\u5b89\u88c5php\u6269\u5c55<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">yum install libgearman-devel -y\r\ncd ~\r\nwget https:\/\/github.com\/wcgallego\/pecl-gearman\/archive\/gearman-2.0.3.tar.gz\r\ntar -zxvf gearman-2.0.3.tar.gz\r\ncd pecl-gearman-gearman-2.0.3\r\nphpize\r\n.\/configure\r\nmake\r\nmake install\r\n\u4fee\u6539php.ini\r\nvim \/usr\/local\/gearman\/php-7.0.13\/lib\/php.ini\r\nextension=gearman.so<\/pre>\n<p>ESC<\/p>\n","protected":false},"excerpt":{"rendered":"<p>gearman\u6240\u9700\u8981\u7684\u4f9d\u8d56 yum install \\ vim \\ git \\ gcc \\ gcc-c++ \\ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[116],"class_list":["post-1593","post","type-post","status-publish","format-standard","hentry","category-linux","tag-gearman"],"_links":{"self":[{"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/posts\/1593","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1593"}],"version-history":[{"count":1,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/posts\/1593\/revisions"}],"predecessor-version":[{"id":1594,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=\/wp\/v2\/posts\/1593\/revisions\/1594"}],"wp:attachment":[{"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1593"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.siediyer.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}