{"id":18670,"date":"2024-11-19T20:48:31","date_gmt":"2024-11-19T12:48:31","guid":{"rendered":"https:\/\/fwq.ai\/blog\/?p=18670"},"modified":"2024-11-19T20:48:31","modified_gmt":"2024-11-19T12:48:31","slug":"%e5%ae%89%e8%a3%85php%e4%b8%ad%e7%9a%84zookeeper%e6%89%a9%e5%b1%95","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/18670\/","title":{"rendered":"\u5b89\u88c5PHP\u4e2d\u7684zookeeper\u6269\u5c55"},"content":{"rendered":"<p>PHP\u7684\u5b89\u88c5\u4ee5\u53ca\u914d\u7f6e\u90fd\u975e\u5e38\u7684\u7b80\u5355\uff0c\u53ef\u4ee5\u53c2\u8003\u6587\u7ae0\uff1aZookeeper\u7684\u5b89\u88c5\uff0c\u4eca\u513f\u6765\u770b\u770bPHP\u6269\u5c55\u7684\u5b89\u88c5\u3002<br \/>\n\u73b0\u5728\u5b98\u65b9\u5df2\u7ecf\u67090.3.2\u7684\u7248\u672c\u4e86\uff0c\u67e5\u770b\u00a0https:\/\/pecl.php.net\/package\/zookeeper<\/p>\n<p>&nbsp;<\/p>\n<h1>\u5b89\u88c5zookeeper Lib<\/h1>\n<p>\u4e0b\u8f7d\u53c2\u8003\uff1aZookeeper\u7684\u5b89\u88c5<\/p>\n<pre># tar -xzf zookeeper-3.4.9.tar.gz\r\n# cd zookeeper-3.4.9\/src\/c\r\n# .\/configure \u2013prefix=\/usr\/local\/zookeeper-lib\/\r\n# make &amp;&amp; make install<\/pre>\n<h1>\u4e0b\u8f7d<\/h1>\n<p>\u5b98\u65b9\u4e0b\u8f7d\u5730\u5740\uff1ahttps:\/\/pecl.php.net\/package\/zookeeper<\/p>\n<pre># tar xzf zookeeper-0.3.1.tgz\r\n# cd zookeeper-0.3.1\r\n# phpize\r\n# .\/configure -with-php-config=\/usr\/local\/php7\/bin\/php-config \r\n-with-libzookeeper-dir=\/usr\/local\/zookeeper-lib\/\r\n# make \r\n# make install\r\n\r\n\u5728php.ini\u7684\u672b\u5c3e\u589e\u52a0\r\nextension=zookeeper.so<\/pre>\n<h1>\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9519\u8bef<\/h1>\n<ol>\n<li><strong>error: zookeeper support requires libzookeeper. Use \u2013with-libzookeeper-dir=&lt;DIR&gt; to specify the prefix where libzookeeper headers and library are located<\/strong><br \/>\n\u9700\u8981\u52a0\u4e0a-with-libzookeeper-dir\u7684\u914d\u7f6e<\/li>\n<li><strong>configure: error: Can\u2019t find zookeeper headers under \u201c\/usr\/local\/zookeeper-lib\u201d<\/strong><br \/>\n\u7f3a\u5c11zookeeper\u7684lib\uff0c\u672c\u4eba\u4f7f\u7528\u7684zookeeper-3.4.9.tar.gz\uff0c\u89e3\u538b\u540e\u76f4\u63a5\u4f7f\u7528\u7684zookeeper\uff0c\u5e76\u6ca1\u6709lib\u3002\u8fd9\u4e2a\u65f6\u5019\u6253\u5f00cd .\/src\/c\uff0c\u6267\u884c .\/configure \u2013prefix=\/usr\/local\/zookeeper-lib\uff08\u751f\u6210zookeeper lib\uff09<\/li>\n<li><strong>appending configuration tag \u201cCXX\u201d to libtool<br \/>\n<\/strong>php\u7684\u6269\u5c55\u7248\u672c\u548czookeeper\u7684\u7248\u672c\u4e0d\u517c\u5bb9\uff0c\u521a\u5f00\u59cb\u4f7f\u7528\u76840.2.3\u7684\u7a33\u5b9a\uff0czookeeper\u4f7f\u7528\u7684\u6700\u65b0\u7684\u7248\u672c\uff0c\u59cb\u7ec8\u5b89\u88c5\u4e0d\u6210\u529f\uff0c\u4e4b\u540e\u4e0b\u8f7d\u4e86\u6700\u65b0\u76840.3.1\u7684\u6269\u5c55\u7248\u672c\uff0c\u624d\u5b89\u88c5\u6210\u529f<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>PHP\u7684\u5b89\u88c5\u4ee5\u53ca\u914d\u7f6e\u90fd\u975e\u5e38\u7684\u7b80\u5355\uff0c\u53ef\u4ee5\u53c2\u8003\u6587\u7ae0\uff1aZookeeper\u7684\u5b89\u88c5\uff0c\u4eca\u513f\u6765\u770b\u770bPHP\u6269\u5c55\u7684\u5b89\u88c5\u3002 \u73b0\u5728\u5b98\u65b9\u5df2\u7ecf\u67090.3.2\u7684\u7248\u672c\u4e86\uff0c\u67e5\u770b\u00a0https:\/\/pecl.php.net\/package\/zookeeper &nbsp; \u5b89\u88c5zookeeper Lib \u4e0b\u8f7d\u53c2\u8003\uff1aZookeeper\u7684\u5b89\u88c5 # tar -xzf zookeeper-3.4.9.tar.gz # cd zookeeper-3.4.9\/src\/c # .\/configure \u2013prefix=\/usr\/local\/zookeeper-lib\/ # make &amp;&amp; make install \u4e0b\u8f7d \u5b98\u65b9\u4e0b\u8f7d\u5730\u5740\uff1ahttps:\/\/pecl.php.net\/package\/zookeeper # tar xzf zookeeper-0.3.1.tgz # cd zookeeper-0.3.1 # phpize # .\/configure -with-php-config=\/usr\/local\/php7\/bin\/php-config -with-libzookeeper-dir=\/usr\/local\/zookeeper-lib\/ # make # make install \u5728php.ini\u7684\u672b\u5c3e\u589e\u52a0 extension=zookeeper.so \u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9519\u8bef error: zookeeper support requires libzookeeper. Use \u2013with-libzookeeper-dir=&lt;DIR&gt; to specify the prefix [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-18670","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18670","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=18670"}],"version-history":[{"count":1,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18670\/revisions"}],"predecessor-version":[{"id":18671,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18670\/revisions\/18671"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=18670"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=18670"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=18670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}