{"id":3322,"date":"2018-03-31T17:36:51","date_gmt":"2018-03-31T09:36:51","guid":{"rendered":"http:\/\/cn.hostease.com\/xueyuan\/?p=3322"},"modified":"2025-01-26T16:38:58","modified_gmt":"2025-01-26T08:38:58","slug":"linux%e4%b8%8b%e5%ae%89%e8%a3%85libiconv%e4%bd%bfphp%e6%94%af%e6%8c%81iconv%e5%87%bd%e6%95%b0","status":"publish","type":"post","link":"https:\/\/cn.hostease.com\/xueyuan\/jishu\/fuwuqi\/linux%e4%b8%8b%e5%ae%89%e8%a3%85libiconv%e4%bd%bfphp%e6%94%af%e6%8c%81iconv%e5%87%bd%e6%95%b0\/","title":{"rendered":"Linux\u4e0b\u5b89\u88c5libiconv\u4f7fphp\u652f\u6301iconv\u51fd\u6570"},"content":{"rendered":"<p>ibiconv\u7ec4\u4ef6\u5b89\u88c5\u597d\u4e86\u53ef\u4ee5\u8ba9\u6211\u4eecphp\u652f\u6301iconv\u51fd\u6570\u4e86\uff0c\u8fd9\u4e2a\u51fd\u6570\u7684\u4f5c\u7528\u5c31\u662f\u5b57\u7b26\u7f16\u7801\u5f3a\u5236\u8f6c\u6362\u4e86\uff0c\u4e0b\u9762\u548c111cn\u5c0f\u7f16\u4e00\u8d77\u6765\u770b\u4e00\u4e2aLinux\u4e2d\u5b89\u88c5libiconv\u4f7fphp\u652f\u6301iconv\u51fd\u6570\u7684\u4f8b\u5b50\u5427\u3002<\/p>\n<p>\u95ee\u9898\uff1a<\/p>\n<p>\u7ebf\u4e0a\u8fd0\u884c\u7684lamp\u670d\u52a1\u5668\uff0cphp\u4e0d\u652f\u6301<u>iconv<\/u>\u51fd\u6570\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<p>\u5b89\u88c5libiconv\uff0c\u91cd\u65b0\u7f16\u8bd1apache\uff0c\u4f7fphp\u652f\u6301iconv\u51fd\u6570\uff0c\u5b9e\u73b0utf-8\u548cgb2312\u7f16\u7801\u7684\u8f6c\u6362\u3002<\/p>\n<p>\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<p>1\u3001\u4e0b\u8f7dlibiconv<\/p>\n<p>cd \/usr\/local\/src<\/p>\n<p>wget https:\/\/ftp.gnu.org\/pub\/gnu\/libiconv\/libiconv-1.14.tar.gz #\u4e0b\u8f7d<\/p>\n<p>2\u3001\u5b89\u88c5libiconv<\/p>\n<p>cd \/usr\/local\/src<\/p>\n<p>tar zxvf libiconv-1.14.tar.gz #\u89e3\u538b<\/p>\n<p>cd libiconv-1.14 #\u8fdb\u5165\u5b89\u88c5\u76ee\u5f55<\/p>\n<p>.\/configure &#8211;prefix=\/usr\/local\/libiconv #\u914d\u7f6e<\/p>\n<p>make #\u7f16\u8bd1<\/p>\n<p>make install #\u5b89\u88c5<\/p>\n<p>3\u3001\u91cd\u65b0\u7f16\u8bd1php<\/p>\n<p>\u67e5\u627e\u7cfb\u7edf\u4e4b\u524d\u7684php\u7f16\u8bd1\u53c2\u6570<\/p>\n<p>cd \/usr\/local\/php\/bin\u00a0 #\u8fdb\u5165<u>php\u5b89\u88c5<\/u>\u76ee\u5f55<\/p>\n<p>.\/php -i |more #\u67e5\u770bphp\u7f16\u8bd1\u53c2\u6570<\/p>\n<p>\u5982\u4e0b\uff1a<\/p>\n<p>&#8216;&#8211;with-pdo_sqlite=shared&#8217; &#8216;&#8211;enable-bcmath=shared&#8217; &#8216;&#8211;enable-ftp=shared&#8217; &#8216;&#8211;enable-mbstring=shared&#8217; &#8216;&#8211;with-iconv=shared&#8217; &#8216;&#8211;enable-sockets=shared&#8217; &#8216;&#8211;enable-zip&#8217; &#8216;&#8211;enable-soap=s<\/p>\n<p>hared&#8217; &#8216;&#8211;with-openssl&#8217; &#8216;&#8211;with-zlib&#8217; &#8216;&#8211;with-curl=shared&#8217; &#8216;&#8211;with-gd=shared&#8217; &#8216;&#8211;with-jpeg-dir&#8217; &#8216;&#8211;with-png-dir&#8217; &#8216;&#8211;with-freetype-dir&#8217; &#8216;&#8211;with-mcrypt=shared&#8217; &#8216;&#8211;with-mhash=shared&#8217; &#8216;&#8211;with-mysql=\/ho<\/p>\n<p>me\/server\/mysql&#8217; &#8216;&#8211;with-mysqli=\/home\/server\/mysql\/bin\/mysql_config&#8217; &#8216;&#8211;with-pdo-mysql=\/home\/server\/mysql\/bin\/mysql_config&#8217; &#8216;&#8211;without-pear&#8217; &#8216;&#8211;with-libdir=lib64&#8217;<\/p>\n<p>\u5bf9\u53c2\u6570\u8fdb\u884c\u4fee\u6539\uff1a<\/p>\n<p>\u5982\u4e0b<\/p>\n<p>.\/configure &#8211;prefix=\/usr\/local\/php &#8211;with-config-file-path=\/usr\/local\/php\/etc &#8211;with-apxs2=\/usr\/local\/apache\/bin\/apxs &#8211;with-gettext=shared &#8211;with-sqlite=shared &#8211;with-pdo_sqlite=shared &#8211;enable-bcmath=shared &#8211;enable-ftp=shared &#8211;enable-mbstring=shared &#8211;with-iconv-dir=\/usr\/local\/libiconv &#8211;enable-sockets=shared &#8211;enable-zip &#8211;enable-soap=shared &#8211;with-openssl &#8211;with-zlib &#8211;with-curl=shared &#8211;with-gd=shared &#8211;with-jpeg-dir &#8211;with-png-dir &#8211;with-freetype-dir &#8211;with-mcrypt=shared &#8211;with-mhash=shared &#8211;with-mysql=\/home\/server\/mysql &#8211;with-mysqli=\/home\/server\/mysql\/bin\/mysql_config &#8211;with-pdo-mysql=\/home\/server\/mysql\/bin\/mysql_config &#8211;without-pear &#8211;with-libdir=lib64<\/p>\n<p>\u5907\u6ce8\uff1a\u4fee\u6539\u90e8\u5206<br \/>\n\u53d6\u6d88\u539f\u6765\u7684&#8211;with-iconv=shared<\/p>\n<p>\u66ff\u6362\u4e3a\uff1a&#8211;with-iconv-dir=\/usr\/local\/libiconv<\/p>\n<p>\u53d6\u6d88\u53c2\u6570\u4e24\u8fb9\u7684\u5355\u5f15\u53f7<\/p>\n<p>\u5176\u5b83\u4e0d\u53d8<\/p>\n<p>cd \/usr\/local\/src\/php #\u8fdb\u5165<u>php\u5b89\u88c5<\/u>\u5305\u76ee\u5f55\uff08\u6ce8\u610fphp\u7248\u672c\u8981\u548c\u4e4b\u524d\u4e00\u6837\uff09<\/p>\n<p>.\/configure &#8211;prefix=\/usr\/local\/php &#8211;with-config-file-path=\/usr\/local\/php\/etc &#8211;with-apxs2=\/usr\/local\/apache\/bin\/apxs &#8211;with-gettext=shared &#8211;with-sqlite=shared &#8211;with-pdo_sqlite=shared &#8211;enable-bcmath=shared &#8211;enable-ftp=shared &#8211;enable-mbstring=shared &#8211;with-iconv-dir=\/usr\/local\/libiconv &#8211;enable-sockets=shared &#8211;enable-zip &#8211;enable-soap=shared &#8211;with-openssl &#8211;with-zlib &#8211;with-curl=shared &#8211;with-gd=shared &#8211;with-jpeg-dir &#8211;with-png-dir &#8211;with-freetype-dir &#8211;with-mcrypt=shared &#8211;with-mhash=shared &#8211;with-mysql=\/home\/server\/mysql &#8211;with-mysqli=\/home\/server\/mysql\/bin\/mysql_config &#8211;with-pdo-mysql=\/home\/server\/mysql\/bin\/mysql_config &#8211;without-pear &#8211;with-libdir=lib64 #\u914d\u7f6e<\/p>\n<p>make #\u7f16\u8bd1<\/p>\n<p>make install #\u5b89\u88c5<\/p>\n<p>4\u3001\u91cd\u542fapache\u4f7f\u8bbe\u7f6e\u751f\u6548<\/p>\n<p>service httpd restart #\u91cd\u542f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ibiconv\u7ec4\u4ef6\u5b89\u88c5\u597d\u4e86\u53ef\u4ee5\u8ba9\u6211\u4eecphp\u652f\u6301iconv\u51fd\u6570\u4e86\uff0c\u8fd9\u4e2a\u51fd\u6570\u7684\u4f5c\u7528\u5c31\u662f\u5b57\u7b26\u7f16\u7801\u5f3a\u5236\u8f6c\u6362\u4e86\uff0c\u4e0b\u9762\u548c1 &#8230; <a title=\"Linux\u4e0b\u5b89\u88c5libiconv\u4f7fphp\u652f\u6301iconv\u51fd\u6570\" class=\"read-more\" href=\"https:\/\/cn.hostease.com\/xueyuan\/jishu\/fuwuqi\/linux%e4%b8%8b%e5%ae%89%e8%a3%85libiconv%e4%bd%bfphp%e6%94%af%e6%8c%81iconv%e5%87%bd%e6%95%b0\/\" aria-label=\"\u9605\u8bfb Linux\u4e0b\u5b89\u88c5libiconv\u4f7fphp\u652f\u6301iconv\u51fd\u6570\">\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[9,11],"tags":[],"class_list":["post-3322","post","type-post","status-publish","format-standard","hentry","category-fuwuqi","category-chengxujiaoben"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/3322","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/comments?post=3322"}],"version-history":[{"count":2,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/3322\/revisions"}],"predecessor-version":[{"id":9876,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/posts\/3322\/revisions\/9876"}],"wp:attachment":[{"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/media?parent=3322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/categories?post=3322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cn.hostease.com\/xueyuan\/wp-json\/wp\/v2\/tags?post=3322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}