{"id":1269,"date":"2020-07-16T13:48:11","date_gmt":"2020-07-16T13:48:11","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2020\/07\/16\/4259219-how-to-display-php-error-messages-in-hostinger\/"},"modified":"2026-10-29T14:59:10","modified_gmt":"2026-10-29T14:59:10","slug":"4259219-how-to-display-php-error-messages-in-hostinger","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/4259219-how-to-display-php-error-messages-in-hostinger\/","title":{"rendered":"How to display PHP error messages in Hostinger"},"content":{"rendered":"<p class=\"no-margin\">Display PHP error messages in Hostinger to find and fix issues in your website&rsquo;s PHP code. There are three methods: enable error display and logging in PHP Configuration, turn on WordPress debugging in the wp-config.php file, or log errors through the .htaccess file.<\/p><p><strong>NOTES<\/strong><\/p><ul>\n<li class=\"no-margin\">The PHP programming language is <b>not used<\/b> in<b> Hostinger AI Builder<\/b>. Therefore, it is not possible to display PHP errors on such websites.<\/li>\n<li class=\"no-margin\">These options apply to PHP functions like <b>Warning, Deprecate, Notice<\/b>, etc. Non-PHP errors, such as 503 errors, database connection issues, etc., will not be logged.<\/li>\n<\/ul><h2 id=\"how-to-enable-errors-display-and-logging-in-hpanel\">Option 1 &ndash; Error display and logging<\/h2><p class=\"no-margin\">You have two settings available on Hostinger dashboard regarding information about PHP errors:<\/p><ul>\n<li>\n<p class=\"no-margin\">To <b>display them on the website<\/b> directly<\/p>\n<\/li>\n<li>\n<p class=\"no-margin\">To <b>store them in a log file<\/b><\/p>\n<\/li>\n<\/ul><p class=\"no-margin\">To enable either or both of them, go to <b><a data-click-id=\"hgr-post-content-link-websites\" class=\"intercom-content-link\" href=\"https:\/\/hpanel.hostinger.com\/websites\" target=\"_blank\" rel=\"noopener\">Websites<\/a> <\/b>&rarr;<b> Manage site<\/b>, search for <b>PHP Configuration<\/b> on the sidebar and click on it:<br>\n<img decoding=\"async\" class=\"aligncenter wp-image-4856 size-full\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/55\/2020\/07\/5ac4ba1d-1b8d-4b98-ad0c-dd5e0503c5a6.jpg\/public\" alt=\"Hostinger dashboard Advanced menu with PHP Configuration highlighted\" width=\"298\" height=\"333\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/55\/2020\/07\/5ac4ba1d-1b8d-4b98-ad0c-dd5e0503c5a6.jpg\/w=298,fit=scale-down 298w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/55\/2020\/07\/5ac4ba1d-1b8d-4b98-ad0c-dd5e0503c5a6.jpg\/w=268,fit=scale-down 268w\" sizes=\"(max-width: 298px) 100vw, 298px\" \/><\/p><p class=\"no-margin\">Once there, head to the <a data-click-id=\"hgr-post-content-link-php-options-tab\" href=\"\/support\/4622479-how-to-change-values-of-php-parameters-in-hostinger\/\">PHP options tab<\/a> and check the corresponding boxes:<\/p><ul>\n<li>\n<p class=\"no-margin\">To make errors visible on your website directly, enable the <b>displayErrors <\/b>(display_errors) parameter<\/p>\n<\/li>\n<li>\n<p class=\"no-margin\">To log a record of the errors to a file, mark the <b>logErrors <\/b>(log_errors) checkbox:<br>\n<img decoding=\"async\" class=\"alignnone size-full wp-image-20743\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/55\/2026\/10\/2026-10-15_16-09.png\/public\" alt=\"\" width=\"1148\" height=\"504\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/55\/2026\/10\/2026-10-15_16-09.png\/w=1148,fit=scale-down 1148w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/55\/2026\/10\/2026-10-15_16-09.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/55\/2026\/10\/2026-10-15_16-09.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/55\/2026\/10\/2026-10-15_16-09.png\/w=768,fit=scale-down 768w\" sizes=\"(max-width: 1148px) 100vw, 1148px\" \/><\/p>\n<\/li>\n<\/ul><p class=\"no-margin\">Scroll down to the bottom of the page and click on <b>Save <\/b>to apply the changes. Scroll down to the bottom of the page and click on Save to apply the changes. To read the logged errors, see <a data-click-id=\"hgr-post-content-link-where-to-find-your-websites-error-logs\" href=\"\/support\/1583298-where-to-find-your-website-s-error-logs-in-hostinger\/\">where to find your website&rsquo;s error logs.<\/a><\/p><h2 id=\"how-to-enable-errors-display-in-wordpress-\">Option 2 &ndash; Display errors on WordPress<\/h2><p class=\"no-margin\">If you are using WordPress, go to the <b><a data-click-id=\"hgr-post-content-link-file-manager\" class=\"intercom-content-link\" href=\"\/support\/4548688-basic-actions-in-the-file-manager-in-hostinger\/\" target=\"_blank\" rel=\"noopener\">File Manager<\/a><\/b> and open your public_html\/<b>wp-config.php<\/b> file. Then, search for the <b>debugging<\/b> line:<\/p><pre><code>define('WP_DEBUG', false);<\/code><\/pre><p class=\"no-margin\">If the line exists, change the value from <b>false<\/b> to <b>true<\/b>. Then, add the following line to enable error display on your website:<\/p><pre><code>define('WP_DEBUG_DISPLAY', true);<\/code><\/pre><p class=\"no-margin\">That&rsquo;s it &ndash; now the PHP errors, if any, will be displayed directly on your WordPress website.<\/p><h2 id=\"h_187e953dcb\">Option 3 &ndash; Display and log errors via the .htaccess file<\/h2><p class=\"no-margin\">You can log the PHP errors to a log file of your choice using the .htaccess file. First, create a <b>backup of the .htaccess file<\/b> before making any changes, as incorrect settings can make your website inaccessible. Or, if there is no .htaccess file, you can <b><a data-click-id=\"hgr-post-content-link-create-it\" class=\"intercom-content-link\" href=\"\/support\/1583307-how-to-create-an-htaccess-file-at-hostinger\/\" target=\"_blank\" rel=\"noopener\">create it<\/a><\/b>.<\/p><p class=\"no-margin\">Next, add the following lines to your website&rsquo;s <b>.htaccess<\/b> file:<\/p><pre><code># log PHP errors to a file\r\nphp_flag log_errors on\r\nphp_value error_reporting 32767\r\nphp_value error_log \"error_log.txt\"<\/code><\/pre><p class=\"no-margin\">Displaying and logging errors with any of these methods will help you troubleshoot your PHP code. Find a vetted developer in the <a data-click-id=\"hgr-post-content-link-hostinger-agency-directory\" class=\"intercom-content-link\" href=\"\/agency-directory\" target=\"_blank\" rel=\"noopener\">Hostinger Agency Directory<\/a> if you need help fixing the cause of an error.<\/p><p class=\"no-margin\"><b>NOTES<\/b><\/p><ul>\n<li>\n<p class=\"no-margin\">Once you are done working with the error data, it is recommended to <b><a data-click-id=\"hgr-post-content-link-hide-it-again\" class=\"intercom-content-link\" href=\"\/support\/1583189-how-to-hide-errors-and-warnings-on-your-website-in-hostinger\/\" target=\"_blank\" rel=\"noopener\">hide it again<\/a><\/b> to prevent potentially sensitive information from being exposed to users and protect against security risks.<\/p>\n<\/li>\n<li>To disable PHP error messages entirely, see <a data-click-id=\"hgr-post-content-link-how-to-turn-off-php-error-messages-in-hostinger\" href=\"\/support\/1583197-how-to-turn-off-php-error-messages-in-hostinger\/\">How to turn off PHP error messages in Hostinger.<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Display PHP error messages in Hostinger via PHP Configuration, WordPress wp-config.php debugging, or .htaccess to troubleshoot your PHP code.<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_content_updated_date":"","include_on_kodee":true,"footnotes":""},"categories":[231],"tags":[],"class_list":["post-1269","post","type-post","status-publish","format-standard","hentry","category-php-errors"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/support\/4259219-how-to-display-php-error-messages-in-hostinger","default":1},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/support\/4259219-como-activar-los-mensajes-de-error-de-php-en-hpanel-en-hostinger","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/support\/4259219-comment-activer-les-messages-d-erreur-php-sur-hpanel-hostinger","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/support\/4259219-cara-mengaktifkan-notifikasi-php-error-di-hpanel-hostinger","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/support\/4259219-como-ativar-as-mensagens-de-erro-php-no-hostinger-hpanel","default":0},{"locale":"uk-UA","link":"https:\/\/www.hostinger.com\/ua\/support\/4259219-\u044f\u043a-\u0443\u0432\u0456\u043c\u043a\u043d\u0443\u0442\u0438-\u043f\u043e\u0432\u0456\u0434\u043e\u043c\u043b\u0435\u043d\u043d\u044f-\u043f\u0440\u043e-\u043f\u043e\u043c\u0438\u043b","default":0}],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1269","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/comments?post=1269"}],"version-history":[{"count":11,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1269\/revisions"}],"predecessor-version":[{"id":23220,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1269\/revisions\/23220"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=1269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=1269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=1269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}