{"id":438293,"date":"2021-04-13T04:26:20","date_gmt":"2021-04-12T20:26:20","guid":{"rendered":"http:\/\/4563.org\/?p=438293"},"modified":"2021-04-13T04:26:20","modified_gmt":"2021-04-12T20:26:20","slug":"%e8%af%b7%e9%97%ae%ef%bc%8c%e6%88%91%e8%af%a5%e5%a6%82%e4%bd%95%e8%ae%be%e7%bd%ae-ini_set-display_errors-%e7%9a%84%e5%80%bc%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=438293","title":{"rendered":"\u8bf7\u95ee\uff0c\u6211\u8be5\u5982\u4f55\u8bbe\u7f6e ini_set display_errors \u7684\u503c\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u8bf7\u95ee\uff0c\u6211\u8be5\u5982\u4f55\u8bbe\u7f6e ini_set display_errors \u7684\u503c\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wfdaj <\/span>  <span><i><\/i> 7<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>Debug \u7c7b\u91cc\u8fd9\u6837\u5199\u7684\uff1a<\/p>\n<pre><code>\/**  * \u662f\u5426\u663e\u793a\u9519\u8bef\uff0c\u9ed8\u8ba4\u4e0d\u663e\u793a  *\/ public static function displayErrors($status = false)     {         if ($status) {             \/\/ \u62a5\u544a\u6240\u6709 PHP \u9519\u8bef             ini_set('display_errors', 1);             error_reporting(E_ALL);         }          \/\/ self::error_handler();     } <\/code><\/pre>\n<p>\u7136\u540e\u8fd9\u6837\u8c03\u7528\u5c31\u65e0\u6548<\/p>\n<pre><code>Debug::displayErrors(1); <\/code><\/pre>\n<p>\u4f46\u6211\u5728\u9875\u9762\u91cc\u76f4\u63a5\u8fd9\u6837\u7528\u53ef\u4ee5\u6b63\u5e38\u8bbe\u7f6e\uff1a<\/p>\n<pre><code>ini_set('display_errors', 1); <\/code><\/pre>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>7<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5660482\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lijialong1313 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6ca1\u61c2\u4f60\u7684\u610f\u601d\uff0c\u5efa\u8bae\u53d1\u5b8c\u6574\u4ee3\u7801\uff0c\u662f\u600e\u4e48\u8bbe\u7f6e\u4e0d\u884c\u600e\u4e48\u884c\u3002<\/p>\n<p>https:\/\/www.php.net\/manual\/zh\/errorfunc.configuration.php                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660483\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : wfdaj <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lijialong1313 \u5c31\u662f\u5728\u9996\u9875 Debug::displayErrors(0); \u8fd9\u6837\u8c03\u7528\u540e\uff0c\u8f93\u51fa display_errors \u7684\u503c\u8fd8\u662f 1 \u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660484\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Oceanhime <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u786e\u5b9a if \u91cc\u9762\u7684\u8bed\u53e5\u771f\u7684\u88ab\u6267\u884c\u4e86\u5417                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660485\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : seth19960929 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f20\u5165 0 \u8f93\u51fa\u503c\u8fd8\u662f 1 \u7684\u539f\u56e0\u53ef\u80fd\u662f\u4f60\u7684 php.ini \u8bbe\u7f6e\u7684\u9ed8\u8ba4\u503c\u662f 1<\/p>\n<p>\u6240\u4ee5\u4e0d\u80fd\u5224\u65ad $status<br \/>\u800c\u662f ini_set(&#8216;display_errors&#8217;, $status);                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660486\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Oceanhime <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @wfdaj \u6309\u6b63\u6587\u91cc\u9762\u7684\u4ee3\u7801\u903b\u8f91\u6765\u770b Debug::displayErrors(0) \u786e\u5b9e\u4e0d\u4f1a\u66f4\u6539 display_errors \u7684\u503c<br \/>\u56e0\u4e3a\u4f60\u53ea\u5199\u4e86 $status \u65f6\u5019\u7684\u64cd\u4f5c, \u6ca1\u6709\u5199 !$status \u65f6\u5019\u7684\u64cd\u4f5c                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660487\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lijialong1313 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @wfdaj \u4f60\u8c03\u7528 0 \u90fd\u6ca1\u8bbe\u7f6e\u6210 error 0<br \/>\u5e94\u8be5\u662f\u7c7b\u4f3c\uff1a<br \/>public static function displayErrors($status = false)<br \/> {<br \/> if ($status) {<br \/> \/\/ \u62a5\u544a\u6240\u6709 PHP \u9519\u8bef<br \/> ini_set(&#8216;display_errors&#8217;, 1);<br \/> error_reporting(E_ALL);<br \/> }<br \/>else{<br \/>ini_set(&#8216;display_errors&#8217;, 0);<br \/>}<\/p>\n<p> \/\/ self::error_handler();<br \/> }                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5660488\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : wfdaj <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u611f\u8c22\u5404\u4f4d\u7684\u5e2e\u52a9\uff0c\u6211\u518d\u8bd5\u8bd5\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u8bf7\u95ee\uff0c\u6211\u8be5\u5982\u4f55\u8bbe\u7f6e ini_set&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/438293"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=438293"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/438293\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=438293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=438293"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=438293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}