{"id":477,"date":"2025-06-10T21:01:49","date_gmt":"2025-06-10T13:01:49","guid":{"rendered":"https:\/\/www.zhaozhao123.cn\/php\/php-application-manual\/jcyy\/477.html"},"modified":"2025-06-10T21:01:49","modified_gmt":"2025-06-10T13:01:49","slug":"%e8%a7%a3%e5%86%b3php-composer%e9%94%99%e8%af%af%ef%bc%9a%e7%bc%ba%e5%b0%91mbstring%e6%89%a9%e5%b1%95","status":"publish","type":"my1js","link":"https:\/\/www.zhaozhao123.cn\/php\/my1js\/477.html","title":{"rendered":"\u89e3\u51b3PHP Composer\u9519\u8bef\uff1a\u7f3a\u5c11\u2018mbstring\u2019\u6269\u5c55"},"content":{"rendered":"<p><body><\/p>\n<h2>&#38382;&#39064;<\/h2>\n<p>&#22914;&#26524;&#20320;&#22312;&#20351;&#29992;PHP&#24182;&#29992;Composer&#31649;&#29702;&#39033;&#30446;&#20381;&#36182;&#65292;&#21487;&#33021;&#20250;&#36935;&#21040;&ldquo;mbstring&#32570;&#22833;&rdquo;&#30340;&#38169;&#35823;&#12290;&#36825;&#34920;&#26126;&ldquo;mbstring&rdquo;&#25193;&#23637;&#65288;&#21363;&#22810;&#23383;&#33410;&#23383;&#31526;&#20018;&#65289;&#26410;&#21551;&#29992;&#25110;&#23433;&#35013;&#22312;&#20320;&#30340;PHP&#29615;&#22659;&#20013;&#12290;&#27492;&#25193;&#23637;&#29992;&#20110;&#22788;&#29702;&#38750;ASCII&#23383;&#31526;&#20018;&#65292;&#22914;UTF-8&#23383;&#31526;&#65292;&#36825;&#20123;&#23383;&#31526;&#24120;&#29992;&#20110;&#25903;&#25345;&#22810;&#31181;&#35821;&#35328;&#30340;&#24212;&#29992;&#31243;&#24207;&#12290;<\/p>\n<p>&#22312;&#26412;&#25945;&#31243;&#20013;&#65292;&#25105;&#20204;&#23558;&#25351;&#23548;&#24744;&#23436;&#25104;&#35299;&#20915;&#27492;&#38169;&#35823;&#30340;&#27493;&#39588;&#65292;&#36890;&#36807;&#23433;&#35013;&#21644;&#21551;&#29992;&ldquo;mbstring&rdquo;PHP&#25193;&#23637;&#26469;&#23454;&#29616;&#19981;&#21516;&#25805;&#20316;&#31995;&#32479;&#21644;&#37197;&#32622;&#12290;<\/p>\n<h3>&#29702;&#35299; &#8216;mbstring&#8217; &#25193;&#23637;<\/h3>\n<p>mbstring PHP&#25193;&#23637;&#25552;&#20379;&#20102;&#24110;&#21161;&#31649;&#29702;&#22810;&#23383;&#33410;&#32534;&#30721;&#23383;&#31526;&#20018;&#30340;&#21151;&#33021;&#12290;PHP&#33258;&#24102;&#30340;&#23383;&#31526;&#20018;&#20989;&#25968;&#34429;&#28982;&#21487;&#20197;&#22788;&#29702;ASCII&#33539;&#22260;&#20869;&#30340;&#23383;&#31526;&#65292;&#20294;&#22312;&#22788;&#29702;&#36229;&#20986;ASCII&#33539;&#22260;&#30340;&#23383;&#31526;&#26102;&#19981;&#22815;&#21487;&#38752;&#12290;mbstring&#25193;&#23637;&#20811;&#26381;&#20102;&#36825;&#19968;&#38480;&#21046;&#65292;&#24182;&#19988;&#23545;&#20110;&#20351;&#29992;UTF-8&#12289;EUC-JP&#21644;Big5&#31561;&#23383;&#31526;&#32534;&#30721;&#36827;&#34892;&#23383;&#31526;&#20018;&#22788;&#29702;&#26469;&#35828;&#33267;&#20851;&#37325;&#35201;&#12290;<\/p>\n<h2>&#22909;&#30340;&#65292;&#25105;&#20204;&#26469;&#35299;&#20915;&#23427;&#12290;<\/h2>\n<h3>&#27493;&#39588; 1&#65306;&#39564;&#35777; PHP &#23433;&#35013;<\/h3>\n<p>&#39318;&#20808;&#65292;&#35831;&#22312;&#32456;&#31471;&#20013;&#36816;&#34892;&#20197;&#19979;&#21629;&#20196;&#26469;&#39564;&#35777;PHP&#26159;&#21542;&#24050;&#23433;&#35013;&#65306;<\/p>\n<pre><code>php -v<\/code><\/pre>\n<p>&#22914;&#26524;&#24050;&#32463;&#23433;&#35013;&#20102;PHP&#65292;&#20320;&#24212;&#35813;&#33021;&#30475;&#21040;&#29256;&#26412;&#20449;&#24687;&#34987;&#25171;&#21360;&#20986;&#26469;&#12290;&#22914;&#26524;&#19981;&#20855;&#22791;&#26465;&#20214;&#65292;&#37027;&#20040;&#38656;&#35201;&#20808;&#36827;&#34892;&#23433;&#35013;&#12290;<\/p>\n<h3>&#27493;&#39588; 2&#65306;&#26816;&#26597;&#26159;&#21542;&#24050;&#23433;&#35013;&ldquo;mbstring&rdquo;&#24211;<\/h3>\n<p>&#20026;&#20102;&#26816;&#26597;&#26159;&#21542;&#24050;&#23433;&#35013;&ldquo;mbstring&rdquo;&#65292;&#35831;&#36816;&#34892;&#65306;<\/p>\n<pre><code>php -m<\/code><\/pre>\n<p>&#22312;&#21015;&#34920;&#20013;&#26597;&#25214;&ldquo;mbstring&rdquo;&#65292;&#22914;&#26524;&#27809;&#26377;&#21015;&#20986;&#65292;&#37027;&#20040;&#23427;&#21487;&#33021;&#27809;&#26377;&#23433;&#35013;&#25110;&#21551;&#29992;&#12290;<\/p>\n<h3>&#27493;&#39588; 3&#65306;&#22312;&#21508;&#31181;&#31995;&#32479;&#19978;&#23433;&#35013; &#8216;mbstring&#8217;&#12290;<\/h3>\n<h4>Ubuntu &#21644; Debian &#26159;&#20004;&#20010;&#27969;&#34892;&#30340; Linux &#21457;&#34892;&#29256;&#12290;<\/h4>\n<p>&#26356;&#26032;&#21253;&#31649;&#29702;&#22120;&#24182;&#23433;&#35013;&#25193;&#23637;&#31243;&#24207;&#65306;<\/p>\n<pre><code>sudo apt-get update\nsudo apt-get install php-mbstring<\/code><\/pre>\n<h4>CentOS&#12289;Fedora&#21644;RHEL&#37117;&#26159;&#22522;&#20110;Red Hat Enterprise Linux&#65288;RHEL&#65289;&#30340;&#21457;&#34892;&#29256;&#65292;&#20294;&#23427;&#20204;&#22312;&#19968;&#20123;&#32454;&#33410;&#19978;&#26377;&#25152;&#19981;&#21516;&#12290;&#36825;&#20123;&#21457;&#34892;&#29256;&#37117;&#25552;&#20379;&#20102;&#19968;&#20010;&#31283;&#23450;&#19988;&#21151;&#33021;&#24378;&#22823;&#30340;Linux&#25805;&#20316;&#31995;&#32479;&#65292;&#24120;&#29992;&#20110;&#26381;&#21153;&#22120;&#29615;&#22659;&#12290;&#35831;&#38382;&#24744;&#38656;&#35201;&#20102;&#35299;&#26356;&#22810;&#20851;&#20110;&#36825;&#20123;&#21457;&#34892;&#29256;&#30340;&#20449;&#24687;&#21527;&#65311;&#20363;&#22914;&#23427;&#20204;&#30340;&#21306;&#21035;&#12289;&#36866;&#29992;&#22330;&#26223;&#31561;&#12290;<\/h4>\n<p>&#20351;&#29992; YUM &#25110; DNF &#23433;&#35013; &#8216;mbstring&#8217;&#65306;<\/p>\n<pre><code>sudo yum install php-mbstring # For CentOS\/RHEL 7\nsudo dnf install php-mbstring # For Fedora or CentOS\/RHEL 8<\/code><\/pre>\n<h4>Windows<\/h4>\n<p>&#35831;&#22312;&#24744;&#30340; php.ini &#25991;&#20214;&#20013; uncomment&#65288;&#21462;&#28040;&#27880;&#37322;&#65289;&#20197;&#19979;&#34892;&#65306;<\/p>\n<pre><code>extension=php_mbstring.dll<\/code><\/pre>\n<p>&#35760;&#24471;&#22312;&#20462;&#25913;php.ini&#25991;&#20214;&#21518;&#37325;&#21551;web&#26381;&#21153;&#22120;&#12290;<\/p>\n<h3>&#27493;&#39588; 4&#65306;&#21551;&#29992;&ldquo;mbstring&rdquo;&#25193;&#23637;<\/h3>\n<p>&#26377;&#26102;&ldquo;mbstring&rdquo;&#24050;&#23433;&#35013;&#20294;&#26410;&#21551;&#29992;&#12290;&#35201;&#21551;&#29992;&#23427;&#65292;&#35831;&#25191;&#34892;&#20197;&#19979;&#25805;&#20316;&#65306;<\/p>\n<h4>Ubuntu&#21644;Debian&#37117;&#26159;&#27969;&#34892;&#30340;Linux&#21457;&#34892;&#29256;&#65292;&#24120;&#29992;&#20110;&#26381;&#21153;&#22120;&#21644;&#26700;&#38754;&#29615;&#22659;&#12290;<\/h4>\n<pre><code>sudo phpenmod mbstring<\/code><\/pre>\n<h4>Windows &#26159;&#19968;&#20010;&#25805;&#20316;&#31995;&#32479;&#21697;&#29260;&#65292;&#30001;&#24494;&#36719;&#20844;&#21496;&#24320;&#21457;&#21644;&#38144;&#21806;&#12290;<\/h4>\n<p>&#30830;&#20445;&#22312;&ldquo;php.ini&rdquo;&#25991;&#20214;&#20013;&#30340;&#34892;&#19981;&#34987;&#27880;&#37322;&#25481;&#65288;&#22914;&#27493;&#39588;3&#25152;&#25552;&#21450;&#30340;&#65289;&#12290;<\/p>\n<h3>&#27493;&#39588; 5&#65306;&#39564;&#35777; mbstring &#23433;&#35013;<\/h3>\n<p>&#22312;&#23433;&#35013;&#21644;&#21551;&#29992;&#21518;&#65292;&#39564;&#35777; mbstring &#26159;&#21542;&#24050;&#21152;&#36733;&#30340;&#26041;&#27861;&#22914;&#19979;&#65306;<br \/>\nphp -m | grep mbstring<br \/>\n&#35831;&#30830;&#20445;&#36755;&#20986;&#20013;&#21253;&#21547; mbstring&#12290;&#22914;&#26524;&#26410;&#25214;&#21040;&#65292;&#21487;&#20197;&#23581;&#35797;&#37325;&#26032;&#23433;&#35013; PHP &#25110;&#26816;&#26597;&#24744;&#30340;&#37197;&#32622;&#26159;&#21542;&#27491;&#30830;&#12290;<\/p>\n<pre><code>php -m | grep mbstring<\/code><\/pre>\n<p>&#20320;&#24212;&#35813;&#29616;&#22312;&#21487;&#20197;&#30475;&#21040;&ldquo;mbstring&rdquo;&#22312;&#36755;&#20986;&#20013;&#12290;<\/p>\n<h3>&#31532;6&#27493;&#65306;&#26356;&#26032;Composer<\/h3>\n<p>&#19968;&#26086;&#21551;&#29992;&ldquo;mbstring&rdquo;&#65292;&#24744;&#36824;&#24212;&#26356;&#26032;Composer&#65306;<\/p>\n<pre><code>composer self-update<\/code><\/pre>\n<p>&#28982;&#21518;&#65292;&#37325;&#35797;&#20320;&#22312;&#36935;&#21040;&#38169;&#35823;&#26102;&#36816;&#34892;&#30340;Composer&#21629;&#20196;&#12290;<\/p>\n<h2>&#26368;&#21518;&#30340;&#35805;<\/h2>\n<p>&#22914;&#26524;&#32463;&#36807;&#36825;&#20123;&#27493;&#39588;&#21518;&#65292;&#20316;&#26354;&#23478;&#20173;&#28982;&#20986;&#29616;&#38169;&#35823;&#65292;&#35831;&#21442;&#38405;&#20197;&#19979;&#19968;&#20123;&#25490;&#26597;&#25552;&#31034;&#65306;<\/p>\n<p>&#20998;&#26512; composer.json &#25991;&#20214;&#20013;&#30340;&#20219;&#20309;&#19981;&#19968;&#33268;&#20043;&#22788;&#12290;<\/p>\n<p>&#26816;&#26597;&#24744;&#26159;&#21542;&#26377;&#22810;&#20110;&#19968;&#20010;&#30340;PHP&#23433;&#35013;&#65292;&#28982;&#21518;&#35843;&#25972;Composer&#20197;&#20351;&#29992;&#27491;&#30830;&#30340;&#37027;&#20010;&#12290;<\/p>\n<p>&#30830;&#35748;PHP&#21644;Composer&#26159;&#21542;&#20351;&#29992;&#30456;&#21516;&#30340;PHP&#37197;&#32622;&#12290;<\/p>\n<p>&#30830;&#20445;&#24744;&#30340;PHP&#21644;Composer&#29256;&#26412;&#20860;&#23481;&#12290;<\/p>\n<p>&#22788;&#29702;PHP&#25193;&#23637;&#26102;&#21487;&#33021;&#20250;&#36935;&#21040;&#19968;&#20123;&#40635;&#28902;&#65292;&#20294;&#24184;&#36816;&#30340;&#26159;&#65292;&#36825;&#20010;&#27969;&#31243;&#25351;&#21335;&#24050;&#32463;&#31616;&#21270;&#20102;&#23433;&#35013;&#21644;&#21551;&#29992;&#36807;&#31243;&#65292;&#24110;&#21161;&#20320;&#35299;&#20915;&ldquo;mbstring&#32570;&#22833;&rdquo;Composer&#38169;&#35823;&#12290;&#29616;&#22312;&#65292;&ldquo;mbstring&rdquo;&#25193;&#23637;&#24050;&#27491;&#30830;&#23433;&#35013;&#24182;&#21551;&#29992;&#65292;&#20320;&#21487;&#20197;&#32487;&#32493;&#20351;&#29992;&#23427;&#26469;&#26500;&#24314;&#20320;&#30340;PHP&#24212;&#29992;&#31243;&#24207;&#65292;&#23613;&#24773;&#20139;&#21463;&#25152;&#26377;&#22269;&#38469;&#23383;&#31526;&#20018;&#25805;&#20316;&#30340;&#24378;&#22823;&#21151;&#33021;&#12290;<\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#38382;&#39064; &#22914;&#26524;&#20320;&#22312;&#20351;&#29992;PHP&#24182;&#29992;Composer&#31649;&#29702;&#39033;&#30446;&#20381;&#36182;&#65292;&#21487;&#038;#33..<\/p>\n","protected":false},"author":1,"featured_media":0,"menu_order":0,"template":"","meta":{"_acf_changed":false},"tags":[],"my1js2nav":[38],"tuisongtax":[],"class_list":["post-477","my1js","type-my1js","status-publish","hentry","my1js2nav-jcyy"],"acf":{"qian_art_seotitle":"","qian_art_seotitle_source":{"label":"SEO\u6807\u9898","type":"text","formatted_value":""},"qian_art_seokws":"","qian_art_seokws_source":{"label":"SEO\u5173\u952e\u8bcd","type":"text","formatted_value":""},"qian_art_stzhong":"","qian_art_stzhong_source":{"label":"\u4e2d | \u77ed\u6807\u9898","type":"text","formatted_value":""}},"_links":{"self":[{"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/my1js\/477","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/my1js"}],"about":[{"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/types\/my1js"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/users\/1"}],"wp:attachment":[{"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/media?parent=477"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/tags?post=477"},{"taxonomy":"my1js2nav","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/my1js2nav?post=477"},{"taxonomy":"tuisongtax","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/tuisongtax?post=477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}