{"id":7495,"date":"2026-04-08T09:24:37","date_gmt":"2026-04-08T07:24:37","guid":{"rendered":"https:\/\/mybox.com\/help\/?post_type=manual_kb&#038;p=7495"},"modified":"2026-04-08T09:24:39","modified_gmt":"2026-04-08T07:24:39","slug":"how-to-display-php-script-error-messages","status":"publish","type":"manual_kb","link":"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-display-php-script-error-messages\/","title":{"rendered":"How to display PHP script error messages"},"content":{"rendered":"\n<div class=\"translation-block translation-block-merged\">\n<p class=\"wp-block-paragraph\">By default, the <strong>mybox<\/strong> infrastructure suppresses PHP error messages on live websites. This is a security measure designed to prevent sensitive information\u2014such as file paths or database structures\u2014from being visible to your visitors.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If your script is not working correctly, you may see a blank page (often called the &#8220;White Screen of Death&#8221;) or a generic error. To find the cause, you must manually enable error reporting to see the specific diagnostic messages.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-display-php-script-error-messages\/#How_to_enable_error_reporting\" >How to enable error reporting<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-display-php-script-error-messages\/#Common_causes_for_script_errors\" >Common causes for script errors<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-display-php-script-error-messages\/#Practical_Implications\" >Practical Implications<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-display-php-script-error-messages\/#Summary\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_enable_error_reporting\"><\/span>How to enable error reporting<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<\/div>\n\n<div id=\"mybox-1020207947\" class=\"mybox-content mybox-entity-placement\"><div class=\"early-access-banner-inpost\">\r\n  <div class=\"banner-left-inpost\">\r\n    <div class=\"icon-box-inpost\">\r\n      <img decoding=\"async\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2026\/02\/square-info-icon.svg\" alt=\"Info\">\r\n    <\/div>\r\n    <div class=\"text-box-inpost\">\r\n      <span class=\"label-inpost\"><span class=\"translation-block translation-block-banner-text\">Early access<\/span><\/span>\r\n      <h4><span class=\"translation-block translation-block-banner-text\">Still need help?<\/span><\/h4>\r\n      <p><span class=\"translation-block translation-block-banner-text\">Contact our customer service team.<\/span><\/p>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <div class=\"banner-right-inpost\">\r\n    <a href=\"https:\/\/panel.mybox.com\/helpdesk2\/v\/list\/\" class=\"banner-button-inpost\"><span class=\"translation-block translation-block-banner-text\">Message us<\/span><\/a>\r\n  <\/div>\r\n<\/div><\/div>\n\n<div class=\"translation-block translation-block-merged\"><p class=\"wp-block-paragraph\">The most direct way to debug a single script is to add a directive directly to your PHP file (e.g., <code>index.php<\/code>). Place the following code at the very top of your file, immediately after the opening <code>&lt;?php<\/code> tag:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">PHP<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ini_set('display_errors', 1);\nini_set('display_startup_errors', 1);\nerror_reporting(E_ALL);\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once this code is in place, refreshing your website will display any active errors, warnings, or notices directly in your browser.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Common_causes_for_script_errors\"><\/span>Common causes for script errors<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">When analyzing the displayed errors, consider these frequent triggers:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>PHP Version Mismatch:<\/strong> Your script may use functions that were deprecated in newer PHP versions or require features not available in older ones.<\/li>\n\n\n\n<li><strong>Missing Extensions:<\/strong> Some scripts require specific PHP modules (like <code>mbstring<\/code>, <code>imagick<\/code>, or <code>gd<\/code>) that might not be active for your domain.<\/li>\n\n\n\n<li><strong>Syntax Errors:<\/strong> Simple typos or missing semicolons in your code will prevent the entire script from executing.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Practical_Implications\"><\/span>Practical Implications<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Security Risk:<\/strong> Never leave error reporting active on a production website. Once you have identified the problem, <strong>remove the code<\/strong> to keep your server paths hidden from the public.<\/li>\n\n\n\n<li><strong>Version Adjustments:<\/strong> If the error indicates a &#8220;Deprecated function&#8221; or &#8220;Call to undefined function,&#8221; try changing your PHP version in the <strong>mybox<\/strong> panel to see if the script was designed for an older or newer environment.<\/li>\n\n\n\n<li><strong>Error Logs:<\/strong> In addition to displaying errors on the screen, <strong>mybox<\/strong> logs these events in the background. You can often find a more detailed history by checking the <code>.logs<\/code> folder in your account via FTP or SSH.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Activating PHP error messages is an essential step for infrastructure literacy. By using the <code>ini_set<\/code> directive, you turn your website into a diagnostic tool, allowing you to bridge the gap between a non-functional script and a working solution.<\/p>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"template":"","format":"standard","manualknowledgebasecat":[43,25,39],"manual_kb_tag":[],"class_list":["post-7495","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-website-errors","manualknowledgebasecat-hosting","manualknowledgebasecat-php-operations"],"_links":{"self":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/7495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/7495\/revisions"}],"predecessor-version":[{"id":7496,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/7495\/revisions\/7496"}],"wp:attachment":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/media?parent=7495"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manualknowledgebasecat?post=7495"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb_tag?post=7495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}