{"id":478,"date":"2025-06-10T21:02:48","date_gmt":"2025-06-10T13:02:48","guid":{"rendered":"https:\/\/www.zhaozhao123.cn\/php\/php-application-manual\/jcyy\/478.html"},"modified":"2025-06-10T21:02:48","modified_gmt":"2025-06-10T13:02:48","slug":"%e8%a7%a3%e5%86%b3-php-composer-%e9%94%99%e8%af%af%ef%bc%9a%e9%9c%80%e8%a6%81-ext_curl-%e6%89%a9%e5%b1%95","status":"publish","type":"my1js","link":"https:\/\/www.zhaozhao123.cn\/php\/my1js\/478.html","title":{"rendered":"\u89e3\u51b3 PHP Composer \u9519\u8bef\uff1a\u9700\u8981 ext_curl \u6269\u5c55"},"content":{"rendered":"<p><body><\/p>\n<h2>&#20171;&#32461;<\/h2>\n<p>&#22312;&#20351;&#29992;PHP&#21644;Composer&#26102;&#65292;&#36935;&#21040;&#19982;&#21253;&#20381;&#36182;&#30456;&#20851;&#30340;&#21508;&#31181;&#38169;&#35823;&#26159;&#24456;&#24120;&#35265;&#30340;&#12290;&#20363;&#22914;&#65292;&#22312;Composer&#25552;&#31034;&ldquo;ext_curl&rdquo;&#26159;&#24517;&#38656;&#30340;&#65292;&#20294;&#24744;&#30340;&#31995;&#32479;&#19978;&#24182;&#26410;&#21551;&#29992;&#25110;&#23433;&#35013;&#35813;&#25193;&#23637;&#26102;&#65292;&#26412;&#25945;&#31243;&#23558;&#25351;&#23548;&#24744;&#35299;&#20915;&#36825;&#20010;&#38382;&#39064;&#12290;<code>ext_curl<\/code>&#38169;&#35823;&#22312;&#20110;&#30830;&#20445;&#27969;&#31243;&#39034;&#30021;&#12290;<\/p>\n<h2>&#29702;&#35299;&#12290;<code>ext_curl<\/code><\/h2>\n<p>cURL &#26159;&#19968;&#20010;&#24378;&#22823;&#30340;&#21629;&#20196;&#34892;&#24037;&#20855;&#65292;&#29992;&#20110;&#20351;&#29992; URL &#26684;&#24335;&#20256;&#36755;&#25968;&#25454;&#12290;&#22312; PHP &#20013;&#65292;&#25552;&#20379;&#20102;&#19968;&#20010;&#21517;&#20026; ext_curl &#30340;&#25193;&#23637;&#26469;&#23454;&#29616;&#36825;&#20123;&#21151;&#33021;&#12290;&#36825;&#20010;&#25193;&#23637;&#20801;&#35768;&#24744;&#36890;&#36807;&#19981;&#21516;&#30340;&#26381;&#21153;&#22120;&#21644;&#21327;&#35758;&#31867;&#22411;&#36827;&#34892;&#36830;&#25509;&#21644;&#36890;&#20449;&#12290;<\/p>\n<h3>&#24341;&#21457;&#38169;&#35823;&#30340;&#21407;&#22240;&#26159;&#20160;&#20040;&#65311;<\/h3>\n<p>&#8220;requires ext_curl&#8221; &#38169;&#35823;&#36890;&#24120;&#22312; Composer &#26816;&#26597;&#24744;&#23581;&#35797;&#23433;&#35013;&#30340;&#21253;&#30340;&#38656;&#27714;&#26102;&#21457;&#29983;&#65292;&#32780;&#26816;&#27979;&#19981;&#21040; cURL &#25193;&#23637;&#12290;&#36825;&#21487;&#33021;&#26159;&#30001;&#20110;&#20197;&#19979;&#21407;&#22240;&#65306;<\/p>\n<p>&#35813;&#25193;&#23637;&#23578;&#26410;&#21551;&#29992;&#12290;<code>php.ini<\/code>&#25991;&#20214;&#12290;<\/p>\n<p>&#25193;&#23637;&#31243;&#24207;&#26410;&#23433;&#35013;&#22312;&#26381;&#21153;&#22120;&#19978;&#12290;<\/p>\n<h2>&#20998;&#27493;&#35299;&#20915;&#26041;&#26696;<\/h2>\n<p>&#20197;&#19979;&#26159;&#35299;&#20915;&#35813;&#38382;&#39064;&#30340;&#27493;&#39588;&#65306;<\/p>\n<h3>&#26816;&#26597;&#26159;&#21542;&#24050;&#23433;&#35013; curl&#12290;<\/h3>\n<p>&#35831;&#25171;&#24320;&#32456;&#31471;&#25110;&#21629;&#20196;&#34892;&#30028;&#38754;&#65292;&#28982;&#21518;&#36755;&#20837;&#20197;&#19979;&#21629;&#20196;&#65306;<\/p>\n<pre><code>php -m | grep curl<\/code><\/pre>\n<p>&#22914;&#26524;&#36755;&#20986;&#26174;&#31034;&#20026;&#8217;curl&#8217;&#65292;&#36825;&#24847;&#21619;&#30528;&#25193;&#23637;&#24050;&#23433;&#35013;&#24182;&#21482;&#38656;&#21551;&#29992;&#21363;&#21487;&#12290;&#22914;&#26524;&#27809;&#26377;&#36820;&#22238;&#20540;&#65292;&#24744;&#38656;&#35201;&#20808;&#36827;&#34892;&#23433;&#35013;&#12290;<\/p>\n<h3>&#23433;&#35013;&#25110;&#21551;&#29992; ext_curl<\/h3>\n<p>&#35201;&#23433;&#35013;&#25110;&#21551;&#29992;&#25193;&#23637;&#65306;<\/p>\n<h4>&#22312;Windows&#19978;&#65306;<\/h4>\n<p>&#20445;&#23384;<code>php.ini<\/code>&#35831;&#23558;&#25991;&#20214;&#20445;&#23384;&#24182;&#37325;&#21551;&#24744;&#30340;Web&#26381;&#21153;&#22120;&#12290;<\/p>\n<p>&#35831;&#31227;&#38500;&#34892;&#39318;&#30340;&#20998;&#21495;&#12290;<code>;extension=curl<\/code>&#21462;&#28040;&#27880;&#37322;&#23427;&#12290;<\/p>\n<p>&#24744;&#21487;&#33021;&#20250;&#21457;&#29616;&#20004;&#20010;<code>php.ini<\/code>&#25991;&#20214;&#65292;&#19968;&#20010;&#29992;&#20110;CLI&#65292;&#21478;&#19968;&#20010;&#29992;&#20110;Apache&#12290;&#30830;&#20445;&#32534;&#36753;&#19982;&#24744;&#30340;&#35774;&#32622;&#30456;&#20851;&#30340;&#37027;&#19968;&#20221;&#12290;&#22914;&#26524;&#24744;&#19981;&#30830;&#23450;&#65292;&#21487;&#20197;&#21516;&#26102;&#32534;&#36753;&#20004;&#20221;&#12290;<\/p>\n<p>&#25214;&#21040;&#24182;&#25171;&#24320;&#24744;&#30340;&#12290;<code>php.ini<\/code>&#25991;&#20214;&#36890;&#24120;&#20301;&#20110;&#24744;&#30340;PHP&#23433;&#35013;&#30446;&#24405;&#20013;&#12290;<\/p>\n<h4>&#22312;Unix\/Linux\/Mac&#19978;&#65306;<\/h4>\n<p>&#37325;&#21551;Web&#26381;&#21153;&#22120;&#65292;&#35831;&#31245;&#31561;&#12290;<code>sudo service apache2 restart<\/code>&#23545;&#20110;Apache&#65292;&#36824;&#26159;&#65311;<code>sudo service nginx restart<\/code>&#23545;&#20110;Nginx&#12290;<\/p>\n<p>&#20351;&#29992;&#24744;&#30340;&#21253;&#31649;&#29702;&#22120;&#23433;&#35013;curl&#65292;&#20363;&#22914;<code>sudo apt-get install php-curl<\/code>&#23545;&#20110;Ubuntu\/Debian&#65292;&#36824;&#26159;&#20351;&#29992;Python&#30340;requests&#24211;&#26469;&#21457;&#36865;HTTP&#35831;&#27714;&#21543;&#12290;<code>sudo yum install php-curl<\/code>&#23545;&#20110;CentOS\/Fedora&#12290;<\/p>\n<h3>&#26816;&#26597;&#24744;&#30340;PHP&#29256;&#26412;&#12290;<\/h3>\n<p>&#30830;&#20445;CURL&#22312;PHP&#20013;&#30340;&#29256;&#26412;&#19982;Composer&#20351;&#29992;&#30340;&#29256;&#26412;&#19968;&#33268;&#12290;&#26377;&#26102;&#65292;Composer&#21487;&#33021;&#20250;&#20351;&#29992;&#19981;&#21516;&#30340;PHP&#29256;&#26412;&#12290;&#20320;&#21487;&#20197;&#36890;&#36807;&#36816;&#34892;&#20197;&#19979;&#21629;&#20196;&#26469;&#26816;&#26597;&#20320;&#30340;PHP&#29256;&#26412;&#65306;<\/p>\n<pre><code>php -v<\/code><\/pre>\n<h3>&#35299;&#20915;&#29256;&#26412;&#29305;&#23450;&#38382;&#39064;<\/h3>\n<p>&#30830;&#20445;&#20320;&#22312;&#20351;&#29992;PHP&#26102;&#25903;&#25345;cURL&#12290;&#22914;&#26524;&#20320;&#26368;&#36817;&#21319;&#32423;&#20102;PHP&#65292;&#30830;&#35748;&#26032;&#29256;&#26412;&#20063;&#21253;&#21547;cURL&#25193;&#23637;&#12290;&#21487;&#33021;&#38656;&#35201;&#20877;&#27425;&#23433;&#35013;&#23427;&#20197;&#36866;&#24212;&#26032;&#30340;&#29256;&#26412;&#12290;<\/p>\n<h3>&#30830;&#35748;&#38382;&#39064;&#26159;&#21542;&#24050;&#35299;&#20915;<\/h3>\n<p>&#23433;&#35013;&#24182;&#21551;&#29992;&#25193;&#23637;&#21518;&#65292;&#20320;&#24212;&#35813;&#36816;&#34892;&#20043;&#21069;&#23548;&#33268;&#38169;&#35823;&#30340;Composer&#21629;&#20196;&#12290;&#22914;&#26524;&#27809;&#26377;&#20986;&#29616;&#38169;&#35823;&#65292;&#37027;&#20040;&#38382;&#39064;&#23601;&#35299;&#20915;&#20102;&#12290;<\/p>\n<h2>&#36827;&#19968;&#27493;&#35299;&#20915;&#25925;&#38556;&#38382;&#39064;&#12290;<\/h2>\n<p>&#22914;&#26524;&#38169;&#35823;&#20173;&#28982;&#23384;&#22312;&#65306;<\/p>\n<p>&#22312;Stack Overflow&#25110;&#31867;&#20284;&#35770;&#22363;&#19978;&#26597;&#25214;&#29305;&#23450;&#38169;&#35823;&#28040;&#24687;&#65292;&#21487;&#20197;&#25214;&#21040;&#20851;&#20110;PHP&#21644;Composer&#30340;&#21508;&#31181;&#38382;&#39064;&#21644;&#35299;&#20915;&#26041;&#26696;&#12290;<\/p>\n<p>&#30830;&#20445;&#32456;&#31471;&#20351;&#29992;&#30340;PHP&#20108;&#36827;&#21046;&#19982;&#24744;&#30340;Web&#26381;&#21153;&#22120;&#20351;&#29992;&#30340;PHP&#20108;&#36827;&#21046;&#30456;&#21516;&#12290;<\/p>\n<p>&#35831;&#26816;&#26597;&#26356;&#25913;&#30340;&#24773;&#20917;&#12290;<code>php.ini<\/code>&#24050;&#32463;&#27491;&#30830;&#20445;&#23384;&#20102;&#12290;<\/p>\n<p>&#37325;&#21551;&#31995;&#32479;&mdash;&mdash;&#25110;&#35768;&#23427;&#38656;&#35201;&#30340;&#23601;&#26159;&#36825;&#20010;&#12290;<\/p>\n<h2>&#32467;&#35770;&#12290;<\/h2>\n<p>&#22788;&#29702;&#22914;&ldquo;requires ext_curl&rdquo;&#36825;&#26679;&#30340;&#38169;&#35823;&#26159;PHP&#24320;&#21457;&#36807;&#31243;&#20013;&#30340;&#19968;&#37096;&#20998;&#12290;&#36890;&#24120;&#65292;&#36825;&#20123;&#38382;&#39064;&#28304;&#20110;&#37197;&#32622;&#38169;&#35823;&#12290;&#36890;&#36807;&#25353;&#29031;&#26412;&#25351;&#21335;&#20013;&#27010;&#36848;&#30340;&#35786;&#26029;&#27493;&#39588;&#65292;&#20320;&#24212;&#35813;&#33021;&#22815;&#35782;&#21035;&#24182;&#35299;&#20915;&#26681;&#26412;&#38382;&#39064;&#65292;&#20174;&#32780;&#20801;&#35768;Composer&#21644;&#24744;&#30340;PHP&#24212;&#29992;&#31243;&#24207;&#27491;&#24120;&#36816;&#34892;&#12290;<\/p>\n<p>&#23545;&#20110;&#26356;&#24494;&#22937;&#30340;&#38382;&#39064;&#25110;&#24744;&#36935;&#21040;&#26032;&#29256;&#26412;&#30340;PHP&#25110;Composer&#38169;&#35823;&#65292;&#35760;&#20303;&#65292;&#22914;PHP.net&#12289;Composer&#23448;&#26041;&#25991;&#26723;&#20197;&#21450;Stack Overflow&#19978;&#30340;PHP&#31038;&#21306;&#21487;&#20197;&#24110;&#21161;&#24744;&#25552;&#20379;&#23453;&#36149;&#30340;&#25903;&#25345;&#12290;&#37197;&#32622;PHP&#25193;&#23637;&#21487;&#33021;&#20250;&#26377;&#25361;&#25112;&#24615;&#65292;&#20294;&#36890;&#36807;&#27491;&#30830;&#30340;&#30693;&#35782;&#21644;&#24037;&#20855;&#65292;&#24744;&#21487;&#20197;&#27491;&#30830;&#37197;&#32622;&#29615;&#22659;&#24182;&#20445;&#25345;&#24037;&#20316;&#27969;&#31243;&#39640;&#25928;&#19988;&#26080;&#35823;&#12290;<\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#20171;&#32461; &#22312;&#20351;&#29992;PHP&#21644;Composer&#26102;&#65292;&#36935;&#21040;&#19982;&#21253;&#20381;&#36182;&#30456;&#20851;&#30340;&#21508;&#038;#31..<\/p>\n","protected":false},"author":1,"featured_media":0,"menu_order":0,"template":"","meta":{"_acf_changed":false},"tags":[],"my1js2nav":[38],"tuisongtax":[],"class_list":["post-478","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\/478","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=478"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/tags?post=478"},{"taxonomy":"my1js2nav","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/my1js2nav?post=478"},{"taxonomy":"tuisongtax","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/tuisongtax?post=478"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}