{"id":10723,"date":"2023-05-23T05:41:56","date_gmt":"2023-05-23T05:41:56","guid":{"rendered":"https:\/\/www.bodhost.com\/kb\/?p=10723"},"modified":"2026-02-26T14:02:43","modified_gmt":"2026-02-26T14:02:43","slug":"enabling-and-disabling-php-error-messages-in-htaccess","status":"publish","type":"post","link":"https:\/\/www.bodhost.com\/kb\/enabling-and-disabling-php-error-messages-in-htaccess\/","title":{"rendered":"Enabling and Disabling PHP Error Messages in .htaccess"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In this article, we will explain how to enable and disable PHP error message settings in a .htaccess file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Follow the following steps to enable and disable PHP error message settings.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. Log into your account using <strong>SSH<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2. Now, you need to use a text editor here to modify the .htaccess files as follows:<br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add the next line to stop PHP from showing error messages:<br><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">php_flag display_errors Off<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><br>Add the following line, to allow PHP to display error messages.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">php_flag display_errors On<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">3. Click to Save the changes to the&nbsp;<em>.htaccess<\/em>&nbsp;file and exit the text editor.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4. To check the new setting is active, create a PHP test file that contains the following code in the same directory where the .<em>htaccess<\/em> file is located.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php phpinfo(); ?&gt;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">5. Search for the directive&#8217;s name after loading the test file in your web browser. The new setting that you defined in the .htaccess file should appear in the Local Value column.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this way, you can enable and disable PHP error message settings in an .htaccess file.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will explain how to enable and disable PHP error message settings in a .htaccess file. Follow the following steps to enable and disable PHP error message&hellip;<\/p>\n<p><a href=\"https:\/\/www.bodhost.com\/kb\/enabling-and-disabling-php-error-messages-in-htaccess\/\" class=\"more-link\">Read More<\/a><\/p>\n","protected":false},"author":22,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[666],"tags":[685,1442],"class_list":["post-10723","post","type-post","status-publish","format-standard","hentry","category-general","tag-htaccess","tag-php-error"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Enabling and Disabling PHP Error Messages in .htaccess<\/title>\n<meta name=\"description\" content=\"In this article, we have explain how to enable and disable PHP error message settings in an .htaccess file.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.bodhost.com\/kb\/enabling-and-disabling-php-error-messages-in-htaccess\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Enabling and Disabling PHP Error Messages in .htaccess\" \/>\n<meta property=\"og:description\" content=\"In this article, we have explain how to enable and disable PHP error message settings in an .htaccess file.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bodhost.com\/kb\/enabling-and-disabling-php-error-messages-in-htaccess\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowledge Base - bodHOST\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-23T05:41:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-26T14:02:43+00:00\" \/>\n<meta name=\"author\" content=\"Vincer\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vincer\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/enabling-and-disabling-php-error-messages-in-htaccess\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/enabling-and-disabling-php-error-messages-in-htaccess\\\/\"},\"author\":{\"name\":\"Vincer\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/f3852d74aeac480763235276b5faddd0\"},\"headline\":\"Enabling and Disabling PHP Error Messages in .htaccess\",\"datePublished\":\"2023-05-23T05:41:56+00:00\",\"dateModified\":\"2026-02-26T14:02:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/enabling-and-disabling-php-error-messages-in-htaccess\\\/\"},\"wordCount\":174,\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"keywords\":[\".htaccess\",\"PHP Error\"],\"articleSection\":[\"General Discussion\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/enabling-and-disabling-php-error-messages-in-htaccess\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/enabling-and-disabling-php-error-messages-in-htaccess\\\/\",\"name\":\"Enabling and Disabling PHP Error Messages in .htaccess\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\"},\"datePublished\":\"2023-05-23T05:41:56+00:00\",\"dateModified\":\"2026-02-26T14:02:43+00:00\",\"description\":\"In this article, we have explain how to enable and disable PHP error message settings in an .htaccess file.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/enabling-and-disabling-php-error-messages-in-htaccess\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/enabling-and-disabling-php-error-messages-in-htaccess\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/enabling-and-disabling-php-error-messages-in-htaccess\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"General Discussion\",\"item\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/category\\\/general\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Enabling and Disabling PHP Error Messages in .htaccess\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"alternateName\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"contentUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"width\":240,\"height\":240,\"caption\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/f3852d74aeac480763235276b5faddd0\",\"name\":\"Vincer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g\",\"caption\":\"Vincer\"},\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/author\\\/vinayak\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Enabling and Disabling PHP Error Messages in .htaccess","description":"In this article, we have explain how to enable and disable PHP error message settings in an .htaccess file.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.bodhost.com\/kb\/enabling-and-disabling-php-error-messages-in-htaccess\/","og_locale":"en_US","og_type":"article","og_title":"Enabling and Disabling PHP Error Messages in .htaccess","og_description":"In this article, we have explain how to enable and disable PHP error message settings in an .htaccess file.","og_url":"https:\/\/www.bodhost.com\/kb\/enabling-and-disabling-php-error-messages-in-htaccess\/","og_site_name":"Knowledge Base - bodHOST","article_published_time":"2023-05-23T05:41:56+00:00","article_modified_time":"2026-02-26T14:02:43+00:00","author":"Vincer","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Vincer","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bodhost.com\/kb\/enabling-and-disabling-php-error-messages-in-htaccess\/#article","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/enabling-and-disabling-php-error-messages-in-htaccess\/"},"author":{"name":"Vincer","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/f3852d74aeac480763235276b5faddd0"},"headline":"Enabling and Disabling PHP Error Messages in .htaccess","datePublished":"2023-05-23T05:41:56+00:00","dateModified":"2026-02-26T14:02:43+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bodhost.com\/kb\/enabling-and-disabling-php-error-messages-in-htaccess\/"},"wordCount":174,"publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"keywords":[".htaccess","PHP Error"],"articleSection":["General Discussion"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.bodhost.com\/kb\/enabling-and-disabling-php-error-messages-in-htaccess\/","url":"https:\/\/www.bodhost.com\/kb\/enabling-and-disabling-php-error-messages-in-htaccess\/","name":"Enabling and Disabling PHP Error Messages in .htaccess","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/#website"},"datePublished":"2023-05-23T05:41:56+00:00","dateModified":"2026-02-26T14:02:43+00:00","description":"In this article, we have explain how to enable and disable PHP error message settings in an .htaccess file.","breadcrumb":{"@id":"https:\/\/www.bodhost.com\/kb\/enabling-and-disabling-php-error-messages-in-htaccess\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bodhost.com\/kb\/enabling-and-disabling-php-error-messages-in-htaccess\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.bodhost.com\/kb\/enabling-and-disabling-php-error-messages-in-htaccess\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"General Discussion","item":"https:\/\/www.bodhost.com\/kb\/category\/general\/"},{"@type":"ListItem","position":2,"name":"Enabling and Disabling PHP Error Messages in .htaccess"}]},{"@type":"WebSite","@id":"https:\/\/www.bodhost.com\/kb\/#website","url":"https:\/\/www.bodhost.com\/kb\/","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","description":"","publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"alternateName":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bodhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.bodhost.com\/kb\/#organization","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","url":"https:\/\/www.bodhost.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","contentUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","width":240,"height":240,"caption":"Web Hosting Knowledge Base | bodHOST Hosting FAQ"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/f3852d74aeac480763235276b5faddd0","name":"Vincer","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g","caption":"Vincer"},"url":"https:\/\/www.bodhost.com\/kb\/author\/vinayak\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/10723","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/comments?post=10723"}],"version-history":[{"count":8,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/10723\/revisions"}],"predecessor-version":[{"id":10765,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/10723\/revisions\/10765"}],"wp:attachment":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/media?parent=10723"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/categories?post=10723"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/tags?post=10723"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}