{"id":23,"date":"2015-09-04T13:34:49","date_gmt":"2015-09-04T13:34:49","guid":{"rendered":"http:\/\/www.asianux.org.vn\/?p=23"},"modified":"2015-09-04T13:34:49","modified_gmt":"2015-09-04T13:34:49","slug":"cai-dat-memcache-memcache-php-extension-linux","status":"publish","type":"post","link":"https:\/\/www.asianux.org.vn\/index.php\/2015\/09\/04\/cai-dat-memcache-memcache-php-extension-linux\/","title":{"rendered":"C\u00e0i \u0111\u1eb7t memcache, memcache PHP extension (Linux)"},"content":{"rendered":"<div id=\"hometext\"><a href=\"http:\/\/onlinelab.info\/wp-content\/uploads\/2015\/09\/cropped-Screenshot_4.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-206\" src=\"http:\/\/onlinelab.info\/wp-content\/uploads\/2015\/09\/cropped-Screenshot_4.png\" alt=\"cropped-Screenshot_4.png\" width=\"189\" height=\"165\" title=\"\"><\/a>B\u00e0i vi\u1ebft h\u01b0\u1edbng \u0111\u1eabn c\u00e0i \u0111\u1eb7t Memcached, th\u01b0 vi\u1ec7n \u0111\u1ec3 php c\u00f3 th\u1ec3 k\u1ebft n\u1ed1i t\u1edbi memcached.<\/div>\n<p>&nbsp;<\/p>\n<div class=\"bodytext\">\n<h3>B\u01b0\u1edbc 1<\/h3>\n<div class=\"Textbody\">Download <a href=\"http:\/\/www.monkey.org\/~provos\/libevent\/\" target=\"_blank\" rel=\"noopener\">libevent <\/a>, c\u00e0i \u0111\u1eb7t :<br \/>\n<span class=\"SourceText\">#tar -xvf libevent-1.3b.tar.gz<br \/>\n#cd libevent-1.3b<br \/>\n#.\/configure<br \/>\n#make<br \/>\n#make install;<\/span><\/div>\n<div class=\"Textbody\"><span class=\"StrongEmphasis\">B\u01b0\u1edbc 2 <\/span><br \/>\nDownload<a href=\"http:\/\/www.danga.com\/memcached\/\" target=\"_blank\" rel=\"noopener\"> memcache<\/a>, c\u00e0i \u0111\u1eb7t :<br \/>\n<span class=\"SourceText\">#gunzip memcached-1.2.1.tar.gz<br \/>\n#tar -xvf memcached-1.2.1.tar<br \/>\n#cd memcached-1.2.1<br \/>\n#.\/configure<br \/>\n#make<br \/>\n#make install;<\/span><\/div>\n<div class=\"Textbody\"><span class=\"StrongEmphasis\">B\u01b0\u1edbc 3<\/span><br \/>\nT\u1ea1o li\u00ean k\u1ebft cho memcache :<br \/>\n<span class=\"SourceText\">#ln -s \/usr\/local\/lib\/libevent-1.3b.so.1 \/lib\/libevent-1.3b.so.1<br \/>\nmemcached -d -u nobody -m 512 127.0.0.1 -p 11211<\/span><\/div>\n<div class=\"Textbody\"><span class=\"StrongEmphasis\">B\u01b0\u1edbc 4<\/span><br \/>\nC\u00e0i \u0111\u1eb7t g\u00f3i pecl cho PHP (memcache PHP extension):<br \/>\n<span class=\"SourceText\">#wget http:\/\/pecl.php.net\/get\/memcache-2.1.2.tgz<br \/>\n#gzip -df memcache-2.1.2.tgz<br \/>\n#tar -xvf memcache-2.1.2.tar<br \/>\n#cd memcache-2.1.2<br \/>\n#phpize (Ch\u00fa \u00fd)<br \/>\n#.\/configure<br \/>\n#make<br \/>\n#make install<\/span><\/div>\n<div class=\"Textbody\"><span class=\"StrongEmphasis\">Ch\u00fa \u00fd : <\/span>khi g\u00f5 l\u1ec7nh #phpize c\u00f3 th\u1ec3 s\u1ebd g\u1eb7p l\u1ed7i nh\u01b0 sau :<br \/>\n\u201cCannot find autoconf. Please check your autoconf installation\u201d<br \/>\nL\u1ed7i n\u00e0y l\u00e0 do b\u1ea1n ch\u01b0a install autoconf tr\u00ean h\u1ec7 th\u1ed1ng. B\u1ea1n c\u1ea7n c\u00e0i \u0111\u1eb7t autoconf v\u00e0 m4 cho h\u1ec7 th\u1ed1ng<br \/>\nC\u00e1ch l\u00e0m nh\u01b0 sau:<\/div>\n<div class=\"PreformattedText\"># cd \/usr\/src<\/div>\n<div class=\"PreformattedText\"># wget http:\/\/ftp.gnu.org\/gnu\/m4\/m4-1.4.9.tar.gz<\/div>\n<div class=\"PreformattedText\"># tar -zvxf m4-1.4.9.tar.gz<\/div>\n<div class=\"PreformattedText\"># cd m4-1.4.9\/<\/div>\n<div class=\"PreformattedText\"># .\/configure<\/div>\n<div class=\"PreformattedText\"># make<\/div>\n<div class=\"PreformattedText\"># make install<\/div>\n<div class=\"PreformattedText\"># cd ..\/<\/div>\n<div class=\"PreformattedText\"># wget http:\/\/ftp.gnu.org\/gnu\/autoconf\/autoconf-2.62.tar.gz<\/div>\n<div class=\"PreformattedText\"># tar -zvxf autoconf-2.62.tar.gz<\/div>\n<div class=\"PreformattedText\"># cd autoconf-2.62\/<\/div>\n<div class=\"PreformattedText\"># .\/configure<\/div>\n<div class=\"PreformattedText\"># make<\/div>\n<div class=\"PreformattedText\"># make install<\/div>\n<div class=\"PreformattedText\">Sau \u0111\u00f3 b\u1ea1n c\u00f3 th\u1ec3 configure v\u00e0 install memcache PHP extension b\u00ecnh th\u01b0\u1eddng.<\/div>\n<div class=\"PreformattedText\"><span class=\"StrongEmphasis\">B\u01b0\u1edbc 5<\/span><\/div>\n<div class=\"PreformattedText\">T\u00ecm file php.ini, memcache.so b\u1eb1ng l\u1ec7nh :<\/div>\n<div class=\"PreformattedText\">#whereis php.ini<\/div>\n<div class=\"PreformattedText\">v\u00e0<\/div>\n<div class=\"PreformattedText\">#whereis memcache.so<\/div>\n<div class=\"PreformattedText\">N\u00f3 s\u1ebd ch\u1ec9 \u0111\u01b0\u1eddng d\u1eabn v\u00e0o c\u1ea3 2 file. M\u1edf file php.ini.<\/div>\n<div class=\"PreformattedText\">V\u00e0o th\u01b0 m\u1ee5c ch\u1ee9a file, g\u00f5 l\u1ec7nh :<\/div>\n<div class=\"PreformattedText\">#nano php.ini<\/div>\n<div class=\"PreformattedText\">th\u00eam c\u00e2u l\u1ec7nh sau v\u00e0o file php.ini :<\/div>\n<div class=\"PreformattedText\">extension = \/path\/memcache.so<\/div>\n<div class=\"PreformattedText\">path l\u00e0 \u0111\u01b0\u1eddng d\u1eabn tr\u1ef1c ti\u1ebfp v\u00e0o file memcache.so.<\/div>\n<div class=\"PreformattedText\">Tr\u00ean \u0111\u00e2y l\u00e0 t\u1ea5t c\u1ea3 c\u00e1c b\u01b0\u1edbc c\u1ea7n thi\u1ebft \u0111\u1ec3 c\u00e0i \u0111\u1eb7t memcache cho h\u1ec7 th\u1ed1ng.<\/div>\n<div class=\"PreformattedText\">Ch\u00fac m\u1ecdi ng\u01b0\u1eddi th\u00e0nh c\u00f4ng<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>B\u00e0i vi\u1ebft h\u01b0\u1edbng \u0111\u1eabn c\u00e0i \u0111\u1eb7t Memcached, th\u01b0 vi\u1ec7n \u0111\u1ec3 php c\u00f3 th\u1ec3 k\u1ebft n\u1ed1i t\u1edbi memcached. &nbsp; B\u01b0\u1edbc 1 Download libevent , c\u00e0i \u0111\u1eb7t : #tar -xvf libevent-1.3b.tar.gz #cd libevent-1.3b #.\/configure #make #make install;&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-23","post","type-post","status-publish","format-standard","hentry","category-he-thong"],"_links":{"self":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts\/23","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/comments?post=23"}],"version-history":[{"count":0,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/posts\/23\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/media?parent=23"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/categories?post=23"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.asianux.org.vn\/index.php\/wp-json\/wp\/v2\/tags?post=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}