{"id":1638,"date":"2015-07-31T10:37:30","date_gmt":"2015-07-31T02:37:30","guid":{"rendered":"http:\/\/clear.vimge.com\/?p=1638"},"modified":"2015-07-31T10:39:09","modified_gmt":"2015-07-31T02:39:09","slug":"osx-compile-php-client-memcache","status":"publish","type":"post","link":"https:\/\/blog.vimge.com\/archives\/php\/osx-compile-php-client-memcache.html","title":{"rendered":"OSX\u7cfb\u7edf\u4e0b\u9762\u7f16\u8bd1PHP\u7684memcache\u7b49\u5ba2\u6237\u7aef\u6269\u5c55"},"content":{"rendered":"

\u4e4b\u524d\u7684\u4e00\u7f16\u6587\u7ae0\u300eOS X \u7cfb\u7edfPHP 5.5.9 \u7684 MongoDB\u3001Memcache\u3001Redis\u5ba2\u6237\u7aef\u6a21\u5757\u5206\u4eab<\/a>\u300f\u56e0\u4e3a\u5fae\u4e91\u5206\u4eab\u5b98\u65b9\u4fee\u6539\u4e86\u5206\u4eab\u7b56\u7565\u5bfc\u81f4\u8fde\u63a5\u5931\u6548\u7684\u539f\u56e0\u6587\u4ef6\u65e0\u6cd5\u4e0b\u8f7d(\u5df2\u66f4\u65b0\u94fe\u63a5)\uff0c\u770b\u4e86\u6587\u7ae0\u7684\u7f51\u53cb\u6293\u72c2\u5b9e\u5728\u4e0d\u597d\u610f\u601d\uff0c\u6240\u4ee5\u51b3\u5b9a\u5199\u4e00\u7bc7\u8be6\u7ec6\u7684\u7f16\u8f91\u65b9\u6cd5\uff0c\u5e0c\u671b\u80fd\u6388\u4eba\u4ee5\u6e14\u3002<\/p>\n

PHP\u5ba2\u6237\u7aef\u7f16\u8f91\u4e3b\u8981\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n

\u89e3\u538b\u7f29\u6269\u5c55\u7684\u6e90\u6587\u4ef6\u538b\u7f29\u5305<\/p>\n

\u5728\u89e3\u538b\u540e\u7684\u6839\u76ee\u5f55\u4e0b\u9762\u6267\u884cphpize\u547d\u4ee4<\/p>\n

\/usr\/bin\/phpize<\/p><\/blockquote>\n

\u8fd9\u91cc\u5927\u5bb6\u8981\u6ce8\u610f\u4e86\uff0c\u56e0\u4e3aOSX\u7cfb\u7edf\u81ea\u5e26\u4e00\u4e2a\u6bd4\u8f83\u8001\u7248\u672c\u7684php\u5b89\u88c5\uff0c\u5982\u679c\u5927\u5bb6\u60f3\u4f7f\u7528\u6700\u65b0\u7248\u7684PHP\u7684\u8bdd\u4e0a\u9762\u7684\u547d\u4ee4\u4f7f\u7528\u65b0\u7248phpize\u7684\u547d\u4ee4\u5730\u5740\uff0c\u4e0b\u9762\u5176\u4ed6PHP\u547d\u4ee4\u7c7b\u4f3c<\/p>\n

\u7136\u540e\u5728\u6839\u76ee\u5f55\u4e0b\u9762\u6267\u884c configure \u547d\u4ee4<\/p>\n

\u00a0.\/configure –with-php-config=\/usr\/bin\/php-config<\/p><\/blockquote>\n

\u6ce8\u610f\u8fd9\u4e2a\u65f6\u5019\u53ef\u80fd\u63d0\u793a\u627e\u4e0d\u5230 configure\u547d\u4ee4\uff0c\u90a3\u770b\u770b\u662f\u4e0d\u662f\u6ca1\u6709\u5b89\u88c5 autoconf \u548c automake\uff0c\u5b89\u88c5\u76f8\u5173\u7a0b\u5e8f\u518d\u6b21\u6267\u884c\u5373\u53ef<\/p>\n

\u53e6\u5916\u4e00\u5b9a\u8981\u6ce8\u610f\u53c2\u6570–with-php-config \u7684\u7248\u672c\u548c\u8def\u5f84<\/p>\n

\u63a5\u4e0b\u6765\u6267\u884c\u7f16\u8f91<\/p>\n

make<\/p>\n

make install<\/p><\/blockquote>\n

\u8fd9\u4e2a\u65f6\u5019\u5982\u679c\u7f16\u8f91\u5b89\u88c5\u6210\u529f\u7684\u8bdd\u4f1a\u63d0\u793a\u751f\u6210\u7684\u62d3\u5c55\u4f4d\u7f6e\uff0c\u5728 php.ini \u6587\u4ef6\u6dfb\u52a0 extension=memcache.so<\/p>\n

\u67e5\u770b phpinfo() \u51fd\u6570\u7ed3\u679c\u53ef\u67e5\u770bmemcache \u62d3\u5c55\u4fe1\u606f\u8bf4\u660e\u5b89\u88c5\u6210\u529f\uff0c\u5982\u679c\u4f60\u5f88\u4e0d\u5e78\u4f9d\u7136\u4e0d\u6210\u529f\uff0c\u53ef\u4ee5\u5728\u300e\u5173\u4e8e\u6211<\/a>\u300f\u91cc\u9762\u627e\u5230\u672c\u4eba\u7684\u8054\u7cfb\u65b9\u5f0f<\/p>\n","protected":false},"excerpt":{"rendered":"

\u4e4b\u524d\u7684\u4e00\u7f16\u6587\u7ae0\u300eOS X \u7cfb\u7edfPHP 5.5.9 \u7684 MongoDB\u3001Memcache\u3001Redis\u5ba2\u6237\u7aef\u6a21\u5757\u5206 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[121,9],"tags":[123,122,97],"_links":{"self":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1638"}],"collection":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/comments?post=1638"}],"version-history":[{"count":6,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1638\/revisions"}],"predecessor-version":[{"id":1643,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1638\/revisions\/1643"}],"wp:attachment":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/media?parent=1638"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/categories?post=1638"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/tags?post=1638"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}