{"id":316,"date":"2020-10-08T19:18:04","date_gmt":"2020-10-08T19:18:04","guid":{"rendered":"https:\/\/localwp.com\/?post_type=help&#038;p=316"},"modified":"2026-06-03T12:46:34","modified_gmt":"2026-06-03T12:46:34","slug":"warnings-and-errors-in-local","status":"publish","type":"help","link":"https:\/\/localwp.com\/help-docs\/troubleshooting\/warnings-and-errors-in-local\/","title":{"rendered":"Warnings and Errors in Local"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Are you wondering why a site that is working perfectly on a remote server is suddenly looking very broken when you import it into Local?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Because Local is meant to be a development environment, one possible reason for the site to look broken is that Local is set to be much noisier about issues it encounters.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-group help-doc-toc\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<p class=\"wp-block-paragraph\">Table of Contents:<\/p>\n\n\n<nav aria-label=\"Table of Contents\" class=\"wp-block-table-of-contents\"><ol><li><a class=\"wp-block-table-of-contents__entry\" href=\"#orgf6b2fed\">Why is this happening?<\/a><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"#org813fe38\">PHP Backstory: Error Reporting Levels<\/a><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"#orgb279f15\">Ok Great, but How Do I Fix My Site?<\/a><ol><li><a class=\"wp-block-table-of-contents__entry\" href=\"#org3a3611f\">Quick-fix in\u00a0wp-config.php<\/a><\/li><li><a class=\"wp-block-table-of-contents__entry\" href=\"#orgff0fe23\">Super custom\u00a0php.ini.hbs<\/a><\/li><\/ol><\/li><\/ol><\/nav>\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">By default, Local is set to show both PHP <code>errors<\/code> AND <code>warnings<\/code>. This can be confusing for some users since by default, most remote servers only show PHP <strong>Fatal<\/strong> errors, but suppress warnings. When a site is imported into Local, the warnings that are being suppressed on the remote server are now showing on the Local site, and make the local site appear broken.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s important to remember that the Local site is probably not broken &#8212; it&#8217;s just Local giving you more info about potential problems in the form of PHP warnings.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As an example, this screenshot shows the same site on Flywheel&#8217;s servers (on the left), and within Local (on the right).<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image is-style-drop-shadow\"><img decoding=\"async\" src=\"https:\/\/notabrainer.com\/wp-content\/uploads\/image-70.png\" alt=\"\"\/><figcaption class=\"wp-element-caption\">On the left, a PHP warning isn&#8217;t displayed on a remote site that has warnings hidden. On the right, that same PHP warning is showing a big orange box that is coming from xDebug.<\/figcaption><\/figure>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading has-text-color\" id=\"orgf6b2fed\" style=\"color:#000000\"><strong>Why is this happening?<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There are two reasons why Local looks broken compared to the remote site:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Local has more verbose error reporting enabled, which means it will show warnings and notices in addition to more serious errors.<\/li>\n\n\n\n<li>Local uses Xdebug to make those messages easier to read (and louder!)<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">The reason that Local is configured this way is because it is a development tool. By seeing notices and warnings early, you are in a position to fix things before they become big problems on the production site.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can toggle Xdebug on or off easily from the Local app. From your Local app select the site you&#8217;d like and the toggle option will be at the bottom of that page.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image size-full is-style-drop-shadow\"><img decoding=\"async\" width=\"999\" height=\"650\" src=\"https:\/\/localwp.com\/wp-content\/uploads\/2022\/11\/lhd-xdebug-toggle.png\" alt=\"Toggle on or off Xdebug. \" class=\"wp-image-1766\" srcset=\"https:\/\/localwp.com\/wp-content\/uploads\/2022\/11\/lhd-xdebug-toggle.png 999w, https:\/\/localwp.com\/wp-content\/uploads\/2022\/11\/lhd-xdebug-toggle-300x195.png 300w, https:\/\/localwp.com\/wp-content\/uploads\/2022\/11\/lhd-xdebug-toggle-768x500.png 768w\" sizes=\"(max-width: 999px) 100vw, 999px\" \/><figcaption class=\"wp-element-caption\">Toggle on or off Xdebug. <\/figcaption><\/figure>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading has-text-color\" id=\"org813fe38\" style=\"color:#000000\"><strong>PHP Backstory: Error Reporting Levels<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s a fact of life that sometimes, code generates errors. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">PHP can be configured to display a wide spectrum of those &#8220;errors&#8221;, from really bad ones (<strong>FATAL<\/strong>) to those things that only a nit-picky computer would complain about (<strong>NOTICE<\/strong>).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Newer versions of PHP, and many production environments will default to a setting that looks something like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>E_ALL &amp; ~E_DEPRECATED &amp; ~E_STRICT &amp; ~E_NOTICE<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Which you can read in plain language as saying:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Ok, PHP, show me all your &#8220;errors&#8221;, unless they are a &#8220;Deprecated&#8221;, &#8220;Strict&#8221;, or &#8220;Notice&#8221; error.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Because Local is a development environment, it has a very different setting in place:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>E_ALL &amp; ~E_DEPRECATED<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Again, you can read that in plain language as saying:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">PHP, show me all your &#8220;errors&#8221; except for &#8220;Deprecated&#8221; ones.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">There are definitely different mixes of values you can use, but that should get you understanding the general backdrop of how PHP displays errors.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to know more, you can always take a closer look at some of the resources on the PHP Manual:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.php.net\/manual\/en\/errorfunc.configuration.php#ini.error-reporting\">https:\/\/www.php.net\/manual\/en\/errorfunc.configuration.php#ini.error-reporting<\/a><\/span><\/strong><\/li>\n\n\n\n<li><strong><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.php.net\/manual\/en\/function.error-reporting.php\">https:\/\/www.php.net\/manual\/en\/function.error-reporting.php<\/a><\/span><\/strong><\/li>\n\n\n\n<li><strong><span style=\"text-decoration: underline;\"><a href=\"https:\/\/www.php.net\/manual\/en\/errorfunc.constants.php\">https:\/\/www.php.net\/manual\/en\/errorfunc.constants.php<\/a><\/span><\/strong><\/li>\n<\/ul>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading has-text-color\" id=\"orgb279f15\" style=\"color:#000000\"><strong>Ok Great, but How Do I Fix My Site?<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The best thing to do is to read each message and try to fix things. This might include fixing code or updating plugins.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But sometimes, you&#8217;re not in a position to fix those underlying issues right away, and you just want to work on the site as it is on the remote server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> The next best thing is to adjust the error reporting to more closely match what a production environment looks like.<\/p>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading has-text-color\" id=\"org3a3611f\" style=\"color:#000000\"><strong>Quick-fix in&nbsp;<code>wp-config.php<\/code><\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The easiest way to hide those warnings and notices is to disable error reporting in the <code>wp-config.php<\/code> file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ini_set('display_errors','Off');\nini_set('error_reporting', E_ALL );\ndefine('WP_DEBUG', false);\ndefine('WP_DEBUG_DISPLAY', false);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">There&#8217;s a bit more here than just PHP settings, specifically, we&#8217;re also disabling the errors that WordPress will be showing as well.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image size-large is-style-drop-shadow\"><img decoding=\"async\" width=\"1024\" height=\"626\" src=\"https:\/\/localwp.com\/wp-content\/uploads\/2020\/10\/image-1024x626.png\" alt=\"\" class=\"wp-image-317\" srcset=\"https:\/\/localwp.com\/wp-content\/uploads\/2020\/10\/image-1024x626.png 1024w, https:\/\/localwp.com\/wp-content\/uploads\/2020\/10\/image-300x184.png 300w, https:\/\/localwp.com\/wp-content\/uploads\/2020\/10\/image-768x470.png 768w, https:\/\/localwp.com\/wp-content\/uploads\/2020\/10\/image-1536x940.png 1536w, https:\/\/localwp.com\/wp-content\/uploads\/2020\/10\/image-2048x1253.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Adding configuration settings to the wp-config.php file to prevent PHP warnings from showing.<\/figcaption><\/figure>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading has-text-color\" id=\"orgff0fe23\" style=\"color:#000000\"><strong>Super custom&nbsp;<code>php.ini.hbs<\/code><\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Updating the <code>wp-config.php<\/code> file is pretty quick, but you might want a little more control over the actual settings that PHP is using as opposed to editing the WordPress configuration file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To do this, you&#8217;ll want to adjust the PHP settings that Local uses when starting the site. You can edit those settings by navigating to the <code>php.ini.hbs<\/code> file for the site:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sitename\/conf\/php\/php.ini.hbs<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Note that this is a template that Local uses &#8212; it isn&#8217;t the actual <code>php.ini<\/code> file. This is because different settings behave differently on different Operating Systems. In order update the <code>php.ini<\/code> file for a site in Local, you need to make those adjustments and then restart the site so that Local can re-compile the <code>php.ini.hbs<\/code> file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To update the error reporting settings for the site follow these steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Stop the site in Local<\/li>\n\n\n\n<li>Update and Save&nbsp;<code>php.ini.hbs<\/code><\/li>\n\n\n\n<li>Start the site to have Local use the new settings<\/li>\n<\/ol>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image size-large is-style-drop-shadow\"><img decoding=\"async\" width=\"1024\" height=\"625\" src=\"https:\/\/localwp.com\/wp-content\/uploads\/2020\/10\/image-1-1024x625.png\" alt=\"\" class=\"wp-image-318\" srcset=\"https:\/\/localwp.com\/wp-content\/uploads\/2020\/10\/image-1-1024x625.png 1024w, https:\/\/localwp.com\/wp-content\/uploads\/2020\/10\/image-1-300x183.png 300w, https:\/\/localwp.com\/wp-content\/uploads\/2020\/10\/image-1-768x469.png 768w, https:\/\/localwp.com\/wp-content\/uploads\/2020\/10\/image-1-1536x938.png 1536w, https:\/\/localwp.com\/wp-content\/uploads\/2020\/10\/image-1-2048x1251.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Updating the php.ini.hbs file and restarting the site is another way of preventing warnings and errors from displaying.<\/figcaption><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">You can find more info on all the various adjustments that can be made to this configuration file by looking at PHP&#8217;s documentation on it:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.php.net\/manual\/en\/errorfunc.configuration.php#ini.error-reporting\"><strong><span style=\"text-decoration: underline;\">https:\/\/www.php.net\/manual\/en\/errorfunc.configuration.php#ini.error-reporting<\/span><\/strong><\/a><\/li>\n<\/ul>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-fe48e5de wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/community.localwp.com\/c\/support\/5\" target=\"_blank\" rel=\"noreferrer noopener\">Get Community Support<\/a><\/div>\n<\/div>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Are you wondering why a site that is working perfectly on a remote server is suddenly looking very broken when you import it into Local? Because Local is meant to be a development environment, one possible reason for the site to look broken is that Local is set to be much noisier about issues it&#8230;<\/p>\n","protected":false},"author":49,"parent":349,"menu_order":11,"template":"","tags":[44],"helpcategories":[4],"class_list":["post-316","help","type-help","status-publish","hentry","tag-troubleshooting","helpcategories-troubleshooting"],"acf":{"help_keywords":""},"_links":{"self":[{"href":"https:\/\/localwp.com\/wp-json\/wp\/v2\/help-doc\/316","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/localwp.com\/wp-json\/wp\/v2\/help-doc"}],"about":[{"href":"https:\/\/localwp.com\/wp-json\/wp\/v2\/types\/help"}],"author":[{"embeddable":true,"href":"https:\/\/localwp.com\/wp-json\/wp\/v2\/users\/49"}],"version-history":[{"count":0,"href":"https:\/\/localwp.com\/wp-json\/wp\/v2\/help-doc\/316\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/localwp.com\/wp-json\/wp\/v2\/help-doc\/349"}],"wp:attachment":[{"href":"https:\/\/localwp.com\/wp-json\/wp\/v2\/media?parent=316"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/localwp.com\/wp-json\/wp\/v2\/tags?post=316"},{"taxonomy":"helpcategories","embeddable":true,"href":"https:\/\/localwp.com\/wp-json\/wp\/v2\/helpcategories?post=316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}