{"id":1114,"date":"2012-07-17T23:59:25","date_gmt":"2012-07-17T23:59:25","guid":{"rendered":"http:\/\/www.phpmind.com\/blog\/?p=1114"},"modified":"2012-07-18T00:04:26","modified_gmt":"2012-07-18T00:04:26","slug":"display-php-errors-when-display_errors-is-disabled","status":"publish","type":"post","link":"https:\/\/www.phpmind.com\/blog\/2012\/07\/display-php-errors-when-display_errors-is-disabled\/","title":{"rendered":"Display PHP Errors  When Display_errors Is Disabled"},"content":{"rendered":"<p>When Display_errors is off in php.ini it is hard to see where the bug is!<\/p>\n<p>While you are working in server where display errors are off you can add this code on top of the page and it will show whats going on in your php code.<\/p>\n<pre lang=\"php\">\r\nini_set('display_errors', 1);\r\n ini_set('log_errors', 1);\r\n ini_set('error_log', dirname(__FILE__) . '\/error_log.txt');\r\n error_reporting(E_ALL);\r\n<\/pre>\n<p>I prefer to use this code through a function or include file and when you are done you can close or disable.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When Display_errors is off in php.ini it is hard to see where the bug is! While you are working in server where display errors are off you can add this code on top of the page and it will show whats going on in your php code. ini_set(&#8216;display_errors&#8217;, 1); ini_set(&#8216;log_errors&#8217;, 1); ini_set(&#8216;error_log&#8217;, dirname(__FILE__) . &#8216;\/error_log.txt&#8217;); [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1114","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/1114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/comments?post=1114"}],"version-history":[{"count":4,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/1114\/revisions"}],"predecessor-version":[{"id":1117,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/1114\/revisions\/1117"}],"wp:attachment":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/media?parent=1114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/categories?post=1114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/tags?post=1114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}