{"id":406,"date":"2025-06-10T19:58:20","date_gmt":"2025-06-10T11:58:20","guid":{"rendered":"https:\/\/www.zhaozhao123.cn\/php\/php-application-manual\/jcyy\/406.html"},"modified":"2025-06-10T19:58:20","modified_gmt":"2025-06-10T11:58:20","slug":"php%ef%bc%9a%e5%a6%82%e4%bd%95%e5%90%af%e7%94%a8-%e7%a6%81%e7%94%a8%e9%94%99%e8%af%af%e6%8a%a5%e5%91%8a%ef%bc%88%e4%b8%89%e7%a7%8d%e6%96%b9%e6%b3%95%ef%bc%89","status":"publish","type":"my1js","link":"https:\/\/www.zhaozhao123.cn\/php\/my1js\/406.html","title":{"rendered":"PHP\uff1a\u5982\u4f55\u542f\u7528\/\u7981\u7528\u9519\u8bef\u62a5\u544a\uff08\u4e09\u79cd\u65b9\u6cd5\uff09"},"content":{"rendered":"<p><body><\/p>\n<h3>&#20171;&#32461;<\/h3>\n<p>&#38169;&#35823;&#25253;&#21578;&#26159;PHP&#24320;&#21457;&#20013;&#30340;&#19968;&#20010;&#37325;&#35201;&#26041;&#38754;&#65292;&#23427;&#20801;&#35768;&#24744;&#26597;&#30475;&#20195;&#30721;&#20013;&#30340;&#38169;&#35823;&#12290;&#27491;&#30830;&#37197;&#32622;&#38169;&#35823;&#25253;&#21578;&#21487;&#20197;&#24110;&#21161;&#22312;&#24320;&#21457;&#36807;&#31243;&#20013;&#35843;&#35797;&#20195;&#30721;&#65292;&#24182;&#22312;&#37096;&#32626;&#24212;&#29992;&#31243;&#24207;&#21040;&#29983;&#20135;&#29615;&#22659;&#26102;&#25233;&#21046;&#38169;&#35823;&#12290;&#22312;&#25972;&#20010;&#25351;&#21335;&#20013;&#65292;&#25105;&#20204;&#23558;&#25506;&#35752;PHP&#38169;&#35823;&#30340;&#21407;&#22240;&#20197;&#21450;&#21551;&#29992;&#25110;&#31105;&#29992;&#38169;&#35823;&#25253;&#21578;&#30340;&#20960;&#31181;&#26041;&#27861;&#12290;<\/p>\n<h3>&#29702;&#35299;PHP&#38169;&#35823;<\/h3>\n<p>PHP&#20013;&#30340;&#38169;&#35823;&#21487;&#20197;&#30001;&#22810;&#31181;&#21407;&#22240;&#24341;&#36215;&#65292;&#20363;&#22914;&#35821;&#27861;&#38169;&#35823;&#12289;&#26381;&#21153;&#22120;&#35774;&#32622;&#30340;&#19981;&#27491;&#30830;&#37197;&#32622;&#12289;&#36164;&#28304;&#38480;&#21046;&#25110;&#20195;&#30721;&#20013;&#26410;&#22788;&#29702;&#24322;&#24120;&#24773;&#20917;&#31561;&#12290;&#23427;&#20204;&#36890;&#24120;&#34987;&#20998;&#20026;&#35299;&#26512;&#38169;&#35823;&#12289;&#33268;&#21629;&#38169;&#35823;&#12289;&#35686;&#21578;&#21644;&#36890;&#30693;&#65292;&#27599;&#31181;&#31867;&#22411;&#37117;&#34920;&#31034;&#19981;&#21516;&#30340;&#20005;&#37325;&#31243;&#24230;&#32423;&#21035;&#12290;<\/p>\n<h3>&#35299;&#20915;&#26041;&#26696; 1&#65306;&#20351;&#29992; error_reporting() &#20989;&#25968;<\/h3>\n<p>&#19968;&#31181;&#26368;&#24120;&#35265;&#30340;&#21551;&#29992;&#25110;&#31105;&#29992;&#38169;&#35823;&#25253;&#21578;&#30340;&#26041;&#27861;&#26159;&#20351;&#29992;&#12290;<code>error_reporting()<\/code>&#20989;&#25968;&#12290;&#24744;&#21487;&#20197;&#20351;&#29992;&#27492;&#20989;&#25968;&#35774;&#32622;&#25152;&#38656;&#30340;&#38169;&#35823;&#25253;&#21578;&#32423;&#21035;&#65292;&#36890;&#36807;&#20256;&#36882;&#39044;&#23450;&#20041;&#30340;&#24120;&#37327;&#20316;&#20026;&#21442;&#25968;&#26469;&#23454;&#29616;&#12290;<\/p>\n<p>&#27493;&#39588;2&#65306;&#25320;&#25171;&#30005;&#35805;&#12290;<code>error_reporting()<\/code>&#22312;&#24744;&#33050;&#26412;&#30340;&#24320;&#22987;&#22788;&#24212;&#29992;&#23427;&#12290;<\/p>\n<p>&#27493;&#39588;1&#65306;&#20915;&#23450;&#35201;&#35774;&#32622;&#30340;&#38169;&#35823;&#25253;&#21578;&#32423;&#21035;&#12290;&#20363;&#22914;&#65292;&#22914;&#26524;&#24744;&#24076;&#26395;&#21482;&#25253;&#21578;&#25152;&#26377;&#38169;&#35823;&#65288;&#19981;&#21253;&#25324;&#35686;&#21578;&#21644;&#36890;&#30693;&#65289;&#65292;&#21017;&#24212;&#20351;&#29992;&#12290;<code>E_ALL &amp; ~E_NOTICE &amp; ~E_WARNING<\/code>&#22909;&#30340;&#65292;&#35831;&#25552;&#20379;&#38656;&#35201;&#32763;&#35793;&#30340;&#20869;&#23481;&#12290;<\/p>\n<p>&#35831;&#25552;&#20379;&#38656;&#35201;&#32763;&#35793;&#30340;&#20869;&#23481;&#12290;<\/p>\n<pre><code>&lt;?php\n\/\/ Report all errors except E_NOTICE and E_WARNING\nerror_reporting(E_ALL &amp; ~E_NOTICE &amp; ~E_WARNING);\n\n\/\/ Rest of your PHP code...\n?&gt;\n<\/code><\/pre>\n<p>&#32593;&#39029;&#26381;&#21153;&#22120;&#19981;&#20250;&#26174;&#31034;&#35686;&#21578;&#21644;&#38169;&#35823;&#65292;&#20294;&#25152;&#26377;&#20854;&#20182;&#38169;&#35823;&#37117;&#20250;&#26174;&#31034;&#12290;<\/p>\n<p>&#27880;&#24847;&#20107;&#39033;&#65306;&#20351;&#29992;&#27492;&#21151;&#33021;&#21487;&#20026;&#24320;&#21457;&#21644;&#29983;&#20135;&#29615;&#22659;&#25552;&#20379;&#28789;&#27963;&#24615;&#12290;&#38656;&#35201;&#35760;&#20303;&#30340;&#19968;&#20010;&#38480;&#21046;&#26159;&#65292;&#35813;&#35774;&#32622;&#20165;&#24433;&#21709;&#22312;&#35843;&#29992;&#26102;&#30340;&#33050;&#26412;&#12290;<\/p>\n<h3>&#35299;&#20915;&#26041;&#26696; 2&#65306;&#20462;&#25913; php.ini &#25991;&#20214;<\/h3>\n<p>&#23545;&#19981;&#36215;&#65292;&#25105;&#26080;&#27861;&#29702;&#35299;&#36825;&#21477;&#35805;&#12290;&#35831;&#37325;&#26032;&#25551;&#36848;&#24744;&#30340;&#38382;&#39064;&#25110;&#21477;&#23376;&#65292;&#20197;&#20415;&#25105;&#33021;&#26356;&#22909;&#22320;&#20026;&#24744;&#25552;&#20379;&#24110;&#21161;&#12290;<code>php.ini<\/code>&#25991;&#20214;&#25511;&#21046;&#20102;&#26381;&#21153;&#22120;&#19978;&#25152;&#26377;PHP&#33050;&#26412;&#30340;&#37197;&#32622;&#12290;&#26356;&#26032;&#35813;&#25991;&#20214;&#21487;&#20197;&#35774;&#32622;&#25152;&#26377;&#33050;&#26412;&#30340;&#38169;&#35823;&#25253;&#21578;&#32423;&#21035;&#65292;&#36825;&#23545;&#20110;&#29983;&#20135;&#29615;&#22659;&#38750;&#24120;&#26377;&#29992;&#12290;<\/p>\n<p>&#31532;4&#27493;&#65306;&#37325;&#21551;Web&#26381;&#21153;&#22120;&#65292;&#20197;&#20415;&#26356;&#25913;&#29983;&#25928;&#12290;<\/p>\n<p>&#27493;&#39588;3&#65306;&#25214;&#21040;&#20197;&#26576;&#19968;&#34892;&#24320;&#22987;&#30340;&#34892;&#12290;<code>error_reporting<\/code>&#21644;&#35774;&#32622;&#25152;&#38656;&#30340;&#27700;&#24179;&#65288;&#20363;&#22914;&#65306;&#65289;<code>error_reporting=E_ALL &amp; ~E_NOTICE &amp; ~E_WARNING<\/code>.<\/p>\n<p>&#27493;&#39588;2&#65306;&#25171;&#24320;<code>php.ini<\/code>&#23558;&#25991;&#20214;&#29992;&#36866;&#24403;&#30340;&#26435;&#38480;&#20197;&#25991;&#26412;&#32534;&#36753;&#22120;&#25171;&#24320;&#12290;<\/p>\n<p>&#27493;&#39588;1&#65306;&#23450;&#20301;&#24744;&#30340;&#20301;&#32622;&#12290;<code>php.ini<\/code>&#25991;&#20214;&#30340;&#20301;&#32622;&#21487;&#33021;&#20250;&#26681;&#25454;&#24744;&#30340;&#26381;&#21153;&#22120;&#35774;&#32622;&#32780;&#26377;&#25152;&#19981;&#21516;&#12290;<\/p>\n<p>&#27880;&#24847;&#20107;&#39033;&#65306;&#32534;&#36753;php.ini&#25991;&#20214;&#20250;&#20840;&#23616;&#26356;&#25913;&#25152;&#26377;PHP&#33050;&#26412;&#65292;&#38656;&#35201;&#26381;&#21153;&#22120;&#26435;&#38480;&#65292;&#21487;&#33021;&#22312;&#20849;&#20139;&#20027;&#26426;&#29615;&#22659;&#20013;&#19981;&#21487;&#29992;&#12290;&#35831;&#30830;&#20445;&#38169;&#35823;&#25253;&#21578;&#20851;&#38381;&#25110;&#20165;&#22312;&#29983;&#20135;&#29615;&#22659;&#35774;&#32622;&#20026;&#21482;&#35760;&#24405;&#38169;&#35823;&#20197;&#36991;&#20813;&#23433;&#20840;&#39118;&#38505;&#25110;&#26292;&#38706;&#25935;&#24863;&#20449;&#24687;&#12290;<\/p>\n<h3>&#35299;&#20915;&#26041;&#26696; 3&#65306;&#20351;&#29992; .htaccess &#36827;&#34892;&#36816;&#34892;&#26102;&#37197;&#32622;<\/h3>\n<p>&#23545;&#20110;&#20351;&#29992;Apache&#20316;&#20026;web&#26381;&#21153;&#22120;&#30340;&#29992;&#25143;&#65292;.htaccess&#25991;&#20214;&#25552;&#20379;&#20102;&#22312;&#19981;&#37325;&#21551;&#26381;&#21153;&#22120;&#30340;&#24773;&#20917;&#19979;&#35774;&#32622;PHP&#37197;&#32622;&#30340;&#26041;&#27861;&#12290;&#23427;&#21482;&#24433;&#21709;&#20301;&#20110;&#35813;.htaccess&#25991;&#20214;&#25152;&#22312;&#30340;&#30446;&#24405;&#21450;&#20854;&#23376;&#30446;&#24405;&#20013;&#30340;&#20869;&#23481;&#12290;<\/p>\n<p>&#27493;&#39588;2&#65306;&#28155;&#21152;&#25351;&#20196;<code>php_value error_reporting [value]<\/code>level you want to set is [value].<\/p>\n<p>&#27493;&#39588;1&#65306;&#22312;PHP&#24212;&#29992;&#31243;&#24207;&#30340;&#26681;&#30446;&#24405;&#19979;&#21019;&#24314;&#25110;&#23450;&#20301;&#19968;&#20010;.htaccess&#25991;&#20214;&#12290;<\/p>\n<p>&#36825;&#26159;&#36825;&#26679;&#30340;&#65306;<\/p>\n<pre><code># Disable PHP error reporting\nter_reporting(0)'&gt;php_value error_reporting 0\n\n# Enable reporting of all errors except notices and warnings\nter_reporting(0)'&gt;php_value error_reporting 30711\n<\/code><\/pre>\n<p>&#27880;&#24847;&#20107;&#39033;&#65306;&#27492;&#26041;&#27861;&#20165;&#36866;&#29992;&#20110;Apache Web&#26381;&#21153;&#22120;&#65292;&#38656;&#35201;&#21551;&#29992;.htaccess&#22788;&#29702;&#12290;&#26576;&#20123;&#25176;&#31649;&#25552;&#20379;&#21830;&#21487;&#33021;&#20986;&#20110;&#23433;&#20840;&#21644;&#24615;&#33021;&#21407;&#22240;&#38480;&#21046;&#20351;&#29992;.htaccess&#35206;&#30422;&#12290;<\/p>\n<h3>&#32467;&#35770;&#12290;<\/h3>\n<p>&#22312;&#26412;&#25351;&#21335;&#20013;&#65292;&#25105;&#20204;&#25506;&#35752;&#20102;&#20960;&#31181;&#31649;&#29702;PHP&#38169;&#35823;&#25253;&#21578;&#30340;&#26041;&#27861;&#12290;&#21551;&#29992;&#38169;&#35823;&#25253;&#21578;&#23545;&#20110;&#24320;&#21457;&#33267;&#20851;&#37325;&#35201;&#65292;&#32780;&#23558;&#20854;&#31105;&#29992;&#21017;&#25512;&#33616;&#29992;&#20110;&#29983;&#20135;&#29615;&#22659;&#12290;&#22987;&#32456;&#35760;&#24471;&#23450;&#26399;&#23457;&#26597;&#35774;&#32622;&#65292;&#24182;&#26681;&#25454;&#24212;&#29992;&#31243;&#24207;&#22312;&#19981;&#21516;&#29615;&#22659;&#20043;&#38388;&#30340;&#36807;&#28193;&#36827;&#34892;&#35843;&#25972;&#12290;<\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#20171;&#32461; &#38169;&#35823;&#25253;&#21578;&#26159;PHP&#24320;&#21457;&#20013;&#30340;&#19968;&#20010;&#37325;&#35201;&#26041;&#38754;&#65292;&#23427;&#038;#20..<\/p>\n","protected":false},"author":1,"featured_media":0,"menu_order":0,"template":"","meta":{"_acf_changed":false},"tags":[],"my1js2nav":[38],"tuisongtax":[],"class_list":["post-406","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\/406","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=406"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/tags?post=406"},{"taxonomy":"my1js2nav","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/my1js2nav?post=406"},{"taxonomy":"tuisongtax","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/php\/wp-json\/wp\/v2\/tuisongtax?post=406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}