{"id":164537,"date":"2019-12-11T09:07:27","date_gmt":"2019-12-11T01:07:27","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=164537"},"modified":"2019-11-25T10:08:43","modified_gmt":"2019-11-25T02:08:43","slug":"linux-php-redis","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-php-redis.html","title":{"rendered":"\u8be6\u89e3Linux\u4e2dphp\u73af\u5883\u4e0b\u5b89\u88c5redis\u6269\u5c55"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nPHP\u5373\u201c\u8d85\u6587\u672c\u9884\u5904\u7406\u5668\u201d\uff0c\u662f\u4e00\u79cd\u901a\u7528\u5f00\u6e90\u811a\u672c\u8bed\u8a00\u3002PHP\u662f\u5728\u670d\u52a1\u5668\u7aef\u6267\u884c\u7684\u811a\u672c\u8bed\u8a00\uff0c\u4e0eC\u8bed\u8a00\u7c7b\u4f3c\uff0c\u662f\u5e38\u7528\u7684\u7f51\u7ad9\u7f16\u7a0b\u8bed\u8a00\u3002PHP\u72ec\u7279\u7684\u8bed\u6cd5\u6df7\u5408\u4e86C\u3001Java\u3001Perl\u4ee5\u53ca PHP \u81ea\u521b\u7684\u8bed\u6cd5\u3002\u5229\u4e8e\u5b66\u4e60\uff0c\u4f7f\u7528\u5e7f\u6cdb\uff0c\u4e3b\u8981\u9002\u7528\u4e8eWeb\u5f00\u53d1\u9886\u57df\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u8fd9\u4e2a\u65b9\u6cd5\u5b89\u88c5\u8d77\u6765\u5f88\u7b80\u5355\uff0c\u4e4b\u524d\u4e5f\u662f\u4e00\u76f4\u6309\u7167\u7f51\u4e0a\u7684\u8d44\u6599\u8fdb\u884c\u5b89\u88c5\u3002\u4eca\u5929\u53c8\u9047\u5230\u4e00\u6b21\uff0c\u7d22\u6027\u8bb0\u5f55\u5230\u81ea\u5df1\u7684\u535a\u5ba2 \uff0c\u514d\u5f97\u4e0b\u6b21\u518d\u53bb\u7ffb\u3002<\/p>\n

Linux\u7cfb\u7edfphp5.X<\/strong><\/div>\n
\u4e0b\u8f7d\u7f16\u8bd1<\/strong><\/span><\/div>\n

\u4e0b\u8f7d\uff1ahttps:\/\/github.com\/nicolasff\/phpredis\/archive\/2.2.4.tar.gz\u5230\/usr\/local\/src\u76ee\u5f55<\/p>\n

\r\ncd \/usr\/local\/src #\u8fdb\u5165\u8f6f\u4ef6\u5305\u5b58\u653e\u76ee\u5f55\r\ntar zxvf phpredis-2.2.4.tar.gz #\u89e3\u538b\r\ncd phpredis-2.2.4 #\u8fdb\u5165\u5b89\u88c5\u76ee\u5f55\r\n<\/pre>\n
\u5b89\u88c5\u6269\u5c55<\/strong><\/span><\/div>\n
\r\n\/usr\/local\/php\/bin\/phpize\r\n.\/configure --with-php-config=\/usr\/local\/php\/bin\/php-config \r\nmake\r\nmake install\r\n<\/pre>\n

\u5b89\u88c5\u5b8c\u6210\u4e4b\u540e\uff0c\u51fa\u73b0\u4e0b\u9762\u7684\u5b89\u88c5\u8def\u5f84<\/p>\n

\r\n\/usr\/local\/php\/lib\/php\/extensions\/no-debug-non-zts-20090626\/\r\n<\/pre>\n
\u914d\u7f6ephp\u652f\u6301redis\u6269\u5c55<\/strong><\/div>\n
\r\nvi \/usr\/local\/php\/etc\/php.ini #\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6\uff0c\u5728\u6700\u540e\u4e00\u884c\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\r\n\r\n\u6dfb\u52a0\r\nextension=\"\/usr\/local\/php\/lib\/php\/extensions\/no-debug-non-zts-20090626\/redis.so\"\r\n<\/pre>\n
\u91cd\u542fphp\u89c2\u5bdf\u6548\u679c<\/strong><\/span><\/div>\n

\"\"<\/p>\n

Linux\uff08centos\uff09\u7cfb\u7edfphp7.X<\/strong><\/div>\n

\u4e0b\u8f7d\u5730\u5740: https:\/\/github.com\/phpredis\/phpredis\/archive\/php7.zip<\/p>\n

\u590d\u5236\u5230\/usr\/local\u76ee\u5f55\u4e0b\u89e3\u538b\uff1aunzip phpredis-php7.zip<\/p>\n

\u7136\u540e\u8fdb\u5165\u89e3\u538b\u540e\u7684\u6587\u4ef6\u7684\u76ee\u5f55\uff0c\u5f00\u59cb\u91cd\u65b0\u7f16\u8bd1phpize\uff1a<\/p>\n

\r\ncd phpredis-php7\r\n\/usr\/local\/php\/bin\/phpize\r\n.\/configure --with-php-config=\/usr\/local\/php\/bin\/php-config \r\nmake && make instal\r\n<\/pre>\n

\u6ce8\u610f\uff1aphp-config\u9700\u6839\u636e\u81ea\u5df1\u7684\u7f16\u8bd1\u73af\u5883\u786e\u5b9a\u8def\u5f84\u3002 <\/p>\n

\u6700\u540e\u5728php.ini\u91cc\u9762\u52a0\u5165\uff1aextension=redis.so \u6216\u8005\u52a0\u5165\u7edd\u5bf9\u8def\u5f84\uff0c\u770b\u81ea\u5df1\u914d\u7f6e\u3002\u81f3\u4e8e php.ini\u6587\u4ef6\u53ef\u4ee5\u901a\u8fc7php \u2013ini\u67e5\u770b\u8def\u5f84\u3002\u91cd\u542fphp-fpm\u6216\u8005\u91cd\u542fapache\u4e4b\u7c7b\u7684\u670d\u52a1\uff0c\u901a\u8fc7phpinfo\u67e5\u770b\u3002\u5b8c\u6210\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u8fd9\u4e2a\u65b9\u6cd5\u5b89\u88c5\u8d77\u6765\u5f88\u7b80\u5355\uff0c\u4e4b\u524d\u4e5f\u662f\u4e00\u76f4\u6309\u7167\u7f51\u4e0a\u7684\u8d44\u6599\u8fdb\u884c\u5b89\u88c5\u3002\u4eca\u5929\u53c8\u9047\u5230\u4e00\u6b21\uff0c\u7d22\u6027\u8bb0\u5f55\u5230\u81ea\u5df1\u7684\u535a\u5ba2 \uff0c\u514d\u5f97\u4e0b\u6b21\u518d […]<\/p>\n","protected":false},"author":668,"featured_media":5703,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-164537","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/164537","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/668"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=164537"}],"version-history":[{"count":8,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/164537\/revisions"}],"predecessor-version":[{"id":164974,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/164537\/revisions\/164974"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/5703"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=164537"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=164537"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=164537"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}