{"id":514,"date":"2013-01-24T15:29:39","date_gmt":"2013-01-24T20:29:39","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/2013\/01\/24\/troubleshoot-php-errors\/"},"modified":"2022-09-28T10:34:56","modified_gmt":"2022-09-28T14:34:56","slug":"troubleshoot-php-errors","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/","title":{"rendered":"How to Display and Log PHP Errors"},"content":{"rendered":"<p>There are two methods for viewing PHP errors that occur while running your website. You can either <i>display errors<\/i> directly on your website (viewable from any web browser) or enable <i>error logging<\/i> to write the errors to a specified file (viewable inside a text file). This article will cover <strong>how to turn display_errors <i>On<\/i> and <i>Off<\/i>, adjust error reporting settings, configure error logging, and use the ini_set() function<\/strong> to help troubleshoot PHP errors with your website.<a name=\"editing_the_php_ini\"><\/a><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"#editing_the_php_ini\">Editing the php.ini to Display Errors<\/a><\/li><li><a href=\"#php_ini_settings\">php.ini Error Reporting Settings<\/a><\/li><li><a href=\"#turning_on\">Turning Error Logging On<\/a><\/li><li><a href=\"#using_int_set\">Using int_set() to Display Errors<\/a><\/li><li><a href=\"#maintain\">Maintain Your Log Files<\/a><\/li><\/ul>\n\n\n\n<div class=\"alert alert-warning\" role=\"alert\"><b>WARNING: <\/b>These instructions were written for the EasyApache 3 PHP\/Apache configuration. This older configuration efficiently handles direct modifications to the php.ini file. However, if you are running EasyApache 4, then cPanel\/WHM is designed to maintain the php.ini file(s). Any changes made directly to the php.ini file (while using EA3) may cause this functionality to not perform as expected. Be sure to <a title=\"Click here to navigate to our guide and learn how to check which version of EasyApache your server is running.\" href=\"\/support\/edu\/easyapache\/how-to-check-the-version-of-easyapache-running\/\" target=\"_blank\" rel=\"noopener\">check which version of EasyApache you are running<\/a>, prior to making modifications as outlined in this article.<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"editing_the_php_ini\">Editing the php.ini to Display Errors<\/h2>\n\n\n\n<p>While your site is live, the php.ini file should have <i>display_errors<\/i> disabled for security reasons. However, for the development environment, <i>display_errors<\/i> can be enabled for troubleshooting. Displaying errors should be disabled while the site is live, to protect sensitive information and not interfere with the format of your website pages. When <i>display_error<\/i>s is <i>On<\/i>, your site\u2019s pages will display any PHP errors encountered when loading your website in a browser. This section will explain how to control <i>error reporting<\/i> and turn <i>display_errors<\/i> <i>On<\/i> and <i>Off<\/i>.<\/p>\n\n\n\n<ol class=\"article_list wp-block-list\"><li><a title=\"Click here for info\" rel=\"noopener\" href=\"\/support\/edu\/cpanel\/how-to-log-into-cpanel\/\" target=\"_blank\">Log into your cPanel<\/a>.<\/li><li><a title=\"Click here for info\" rel=\"noopener\" href=\"\/support\/edu\/cpanel\/using-file-manager-in-cpanel\/\" target=\"_blank\">Go to the <i>File Manager<\/i><\/a>. Select the home directory for your website (by default: <i>public_html<\/i>) and click <b>Go<\/b>.<\/li><li>Find the \u201c<em style=\"font-size: revert; color: initial;\">Error handling and logging<\/em><span style=\"font-size: revert; color: initial;\">\u201d section in the php.ini. In order to display or log errors, you need to enable <\/span><i style=\"font-size: revert; color: initial;\">error_reporting<\/i><span style=\"font-size: revert; color: initial;\"> by removing the ( ; ) from in front to the line. You can disable <\/span><i style=\"font-size: revert; color: initial;\">error_reporting<\/i><span style=\"font-size: revert; color: initial;\"> by adding a ( ; ) in front of the line. Refer to the code below: Error reporting disabled:<\/span> <pre style=\"margin-left: 20px;\">;   - Show all errors, except for notices ; ;error_reporting = E_ALL &amp; ~E_NOTICE ; <\/pre> <p>Error reporting enabled to specifically report all errors, but not notices:<\/p> <pre style=\"margin-left: 20px;\">;   - Show all errors, except for notices ; error_reporting = E_ALL &amp; ~E_NOTICE ;  <\/pre><br><img decoding=\"async\" width=\"681\" height=\"324\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/01\/website_website-troubleshooting_error_reporting_error-logging-2-report-all.gif\" class=\"optimized-lcp-image\" alt=\"Report all PHP errors\" loading=\"eager\" fetchpriority=\"high\" sizes=\"(max-width: 768px) 100vw, 768px\"><\/li><li><a rel=\"lightbox-0\" href=\"\/support\/wp-content\/uploads\/2013\/01\/website_website-troubleshooting_error_reporting_error-logging-3-display.gif\"><\/a><div style=\"clear: both;\"><a rel=\"lightbox-0\" href=\"\/support\/wp-content\/uploads\/2013\/01\/website_website-troubleshooting_error_reporting_error-logging-3-display.gif\"><\/a><p>Next you can set the <i>display_errors<\/i> variable to <i>On<\/i> or <i>Off<\/i> to either show the errors on your website or not. Look for the <i>display_errors<\/i> line in the php.ini file and set it to <i>On<\/i> to display errors or <i>Off<\/i> to turn not display errors. The code looks like the following:Display errors:<\/p><pre style=\"margin-left: 20px;\">display_errors = On <\/pre><p>Do not display errors:<\/p><pre style=\"margin-left: 20px;\">display_errors = Off <\/pre><\/div><br><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"221\" class=\"wp-image-5821\" style=\"width: 750px;\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/01\/website_website-troubleshooting_error_reporting_error-logging-3-display.gif\" alt=\"Display PHP errors On\"><a name=\"php_ini_settings\"><\/a><\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"php_ini_settings\">php.ini Error Reporting Settings<\/h2>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"707\" height=\"348\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/01\/website_website-troubleshooting_error_reporting_error-logging-1-list.gif\" alt=\"List of PHP Error reporting settings\" class=\"wp-image-5822\"><\/figure><\/div>\n\n\n\n<p>PHP has a list of different error reporting settings within the php.ini file itself. For example, if you want to display only <i>warnings<\/i> you can change the error_reporting line to the following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">error_reporting = E_WARNING<\/pre>\n\n\n\n<p>The following table was created from the settings found in a standard php.ini file. Refer to the following table for the available options.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><th>List of available options taken from php.ini<\/th><th>Description<\/th><\/tr><tr><th>E_ALL<\/th><td>All errors and warnings<\/td><\/tr><tr><th>E_ERROR<\/th><td>fatal run-time errors<\/td><\/tr><tr><th>E_WARNING<\/th><td>run-time warnings (non-fatal errors)<\/td><\/tr><tr><th>E_PARSE<\/th><td>compile-time parse errors<\/td><\/tr><tr><th>E_DEPRECATED<\/th><td>notices for the use of functions that will be retired in a future version<\/td><\/tr><tr><th>E_NOTICE<\/th><td>run-time notices (these are warnings which often result from a bug in your code, but it\u2019s possible that it was intentional (e.g., using an uninitialized variable and relying on the fact it\u2019s automatically initialized to an empty string)<\/td><\/tr><tr><th>E_CORE_ERROR<\/th><td>fatal errors that occur during PHP\u2019s initial startup<\/td><\/tr><tr><th>E_CORE_WARNING<\/th><td>warnings (non-fatal errors) that occur during PHP\u2019s initial startup<\/td><\/tr><tr><th>E_COMPILE_ERROR<\/th><td>fatal compile-time errors<\/td><\/tr><tr><th>E_COMPILE_WARNING<\/th><td>compile-time warnings (non-fatal errors)<\/td><\/tr><tr><th>E_USER_ERROR<\/th><td>user-generated error message<\/td><\/tr><tr><th>E_USER_WARNING<\/th><td>user-generated warning message<\/td><\/tr><tr><th>E_USER_NOTICE<\/th><td>user-generated notice message<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><a name=\"turning_on\"><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"turning_on\">Turning Error Logging On<\/h2>\n\n\n\n<p>By default errors are written to the <i>error_log<\/i>, which is set to <i>\/dev\/null<\/i>. This means, error logging won\u2019t occur. When errors are turned on, errors will be stored in a file in the directory the error occurs in. For example, if you have a PHP file called <i>index.php<\/i> in a subdirectory like <i>public_html\/wordpress<\/i>, if you have any PHP errors while running that file\u2019s scripts, the error log will be stored in that folder (public_html\/wordpress). You can specify (in the php.ini) which file to store all errors in.<\/p>\n\n\n\n<div class=\"alert alert-warning\" role=\"alert\"><strong>Important!<\/strong> You must place the following code in the .htaccess to make the local php.ini work for the current directory where the .htaccess resides and all subdirectories within.<\/div>\n\n<pre style=\"margin-left: 20px;\">&lt;IfModule mod_suphp.c&gt; suPHP_ConfigPath \/home\/USERNAME\/public_html &lt;\/IfModule&gt;<\/pre>\n\n\n\n<div>The <i>IfModule<\/i> causes Apache to load the directive only if suPHP is used, so the site doesn\u2019t break if switched to another PHP handler such as DSO.<\/div>\n\n\n\n<p>For more information on suPHP and DSO please see our article on <a title=\"Click here for info on suPHP\" href=\"\/support\/website\/choosing-the-best-php-handler\/\" target=\"_blank\" rel=\"noopener\">Choosing the best PHP handler<\/a>.<\/p>\n\n\n\n<ol class=\"article_list wp-block-list\"><li><a title=\"Click here for info\" rel=\"noopener\" href=\"\/support\/edu\/cpanel\/how-to-log-into-cpanel\/\" target=\"_blank\">Log into your cPanel<\/a>.<\/li><li><a title=\"Click here for info\" rel=\"noopener\" href=\"\/support\/edu\/cpanel\/using-file-manager-in-cpanel\/\" target=\"_blank\">Go to the <i>File Manager<\/i><\/a>. Select the <i>public_html<\/i> directory and click <b>Go.<\/b><\/li><li>You can set the following line of code to <i style=\"font-size: revert; color: initial;\">On<\/i><span style=\"font-size: revert; color: initial;\"> to log errors or <\/span><i style=\"font-size: revert; color: initial;\">Off<\/i><span style=\"font-size: revert; color: initial;\"> to turn error logging off.<\/span> <pre style=\"margin-left: 20px;\">log_errors = On  <\/pre><br><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"112\" class=\"wp-image-5823\" style=\"width: 750px;\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/01\/website_website-troubleshooting_error_reporting_error-logging-4-log-errors.gif\" alt=\"Log PHP errors On\"><\/li><li><p>\u00a0<span style=\"font-size: revert; color: initial;\">Next you can save errors from any page in your files to a specific location by specifying the <\/span><i style=\"font-size: revert; color: initial;\">error_log<\/i><span style=\"font-size: revert; color: initial;\">. The example below uses a file named <\/span><i style=\"font-size: revert; color: initial;\">error_log<\/i><span style=\"font-size: revert; color: initial;\"> This will place the error_log in the directory the error occurs in:<\/span><span style=\"color: initial;\"> <\/span><\/p><pre style=\"margin-left: 20px;\">; Log errors to specified file. error_log = error_log <\/pre><p>This will write all errors to the <i>error_log<\/i> file inside the <i>public_html<\/i> directory, regardless of what directory the errors were encountered in:<span style=\"color: initial;\"> <\/span><\/p><pre style=\"margin-left: 20px;\">; Log errors to specified file. error_log = \/home\/userna5\/public_html\/error_log <\/pre><br><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"113\" class=\"wp-image-5824\" style=\"width: 750px;\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/01\/website_website-troubleshooting_error_reporting_error-logging-5-path-to-log.gif\" alt=\"Path to PHP Error log\"><a name=\"using_int_set\"><\/a><\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"using_int_set\">Using int_set() to Display Errors<\/h2>\n\n\n\n<p>In the case you want errors to not display site wide and you want to check errors on a single page, you can use the ini_set() function to have errors displayed on a particular page. The basic syntax from php.net shows the function and its parameters is as follows:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">string ini_set ( string $varname , string $newvalue )<\/pre>\n\n\n\n<p>This can be placed at the top of your PHP page, with the error_reporting variable in it, to allow error checking for that particular page. Below are the steps for how to do this.<\/p>\n\n\n\n<ol class=\"article_list wp-block-list\"><li><a title=\"Click here for info\" rel=\"noopener\" href=\"\/support\/edu\/cpanel\/how-to-log-into-cpanel\/\" target=\"_blank\">Log into your cPanel<\/a>.<\/li><li><a title=\"Click here for info\" rel=\"noopener\" href=\"\/support\/edu\/cpanel\/using-file-manager-in-cpanel\/\" target=\"_blank\">Go to the <i>File Manager<\/i><\/a>. Select the <i>public_html<\/i> directory and click <b>Go<\/b>.<\/li><li>Navigate to the PHP file you want to check errors for. Open the file in the code editor.<\/li><li>In the file, add the following at the top. <pre style=\"margin-left: 20px;\">ini_set('display_errors', '1'); <\/pre><p>1 = On<br>0 = Off<\/p><\/li><li><p>Save the page. <span style=\"color: initial;\">Now your PHP page only will display errors.<\/span><\/p><a name=\"maintain\"><\/a><\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"maintain\">Maintain Your Log Files<\/h2>\n\n\n\n<p>Now that you have enabled error logging, be sure to maintain your log files. If you are getting errors regularly, be sure to remove the logs periodically. You may do so by just removing the file from within the File Manager or through any other method that you prefer to manage your files. A large log file can sometimes cause issues by possibly filling your disk space or if on shared hosting with unlimited disk space, begin to impact other customers on the server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are two methods for viewing PHP errors that occur while running your website. You can either display errors directly on your website (viewable from any web browser) or enable error logging to write the errors to a specified file (viewable inside a text file). This article will cover how to turn display_errors On and<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/\"> Read More ><\/a><\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4288,4335],"tags":[],"class_list":["post-514","post","type-post","status-publish","format-standard","hentry","category-website","category-error-numbers"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Display and Log PHP Errors | InMotion Hosting<\/title>\n<meta name=\"description\" content=\"PHP errors can be turned On and Off or logged in a specific file location. This article will discuss how to turn display errors and error logging On for PHP.\" \/>\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.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Display and Log PHP Errors | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"PHP errors can be turned On and Off or logged in a specific file location. This article will discuss how to turn display errors and error logging On for PHP.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2013-01-24T20:29:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-09-28T14:34:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/01\/website_website-troubleshooting_error_reporting_error-logging-2-report-all.gif\" \/>\n<meta name=\"author\" content=\"InMotion Hosting Contributor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"InMotion Hosting Contributor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/\"},\"author\":{\"name\":\"InMotion Hosting Contributor\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/0ba9f3ef6fadef71df5aa120ff996c41\"},\"headline\":\"How to Display and Log PHP Errors\",\"datePublished\":\"2013-01-24T20:29:39+00:00\",\"dateModified\":\"2022-09-28T14:34:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/\"},\"wordCount\":1164,\"commentCount\":29,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/01\/website_website-troubleshooting_error_reporting_error-logging-2-report-all.gif\",\"articleSection\":[\"Website\",\"Website Error Numbers\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/\",\"name\":\"How to Display and Log PHP Errors | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/01\/website_website-troubleshooting_error_reporting_error-logging-2-report-all.gif\",\"datePublished\":\"2013-01-24T20:29:39+00:00\",\"dateModified\":\"2022-09-28T14:34:56+00:00\",\"description\":\"PHP errors can be turned On and Off or logged in a specific file location. This article will discuss how to turn display errors and error logging On for PHP.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/#primaryimage\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/01\/website_website-troubleshooting_error_reporting_error-logging-2-report-all.gif\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/01\/website_website-troubleshooting_error_reporting_error-logging-2-report-all.gif\",\"width\":681,\"height\":324,\"caption\":\"Click here to view the larger image\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Display and Log PHP Errors\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/0ba9f3ef6fadef71df5aa120ff996c41\",\"name\":\"InMotion Hosting Contributor\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/jamesr\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Display and Log PHP Errors | InMotion Hosting","description":"PHP errors can be turned On and Off or logged in a specific file location. This article will discuss how to turn display errors and error logging On for PHP.","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.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/","og_locale":"en_US","og_type":"article","og_title":"How to Display and Log PHP Errors | InMotion Hosting","og_description":"PHP errors can be turned On and Off or logged in a specific file location. This article will discuss how to turn display errors and error logging On for PHP.","og_url":"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2013-01-24T20:29:39+00:00","article_modified_time":"2022-09-28T14:34:56+00:00","og_image":[{"url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/01\/website_website-troubleshooting_error_reporting_error-logging-2-report-all.gif","type":"","width":"","height":""}],"author":"InMotion Hosting Contributor","twitter_card":"summary_large_image","twitter_creator":"@InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"InMotion Hosting Contributor","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/"},"author":{"name":"InMotion Hosting Contributor","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/0ba9f3ef6fadef71df5aa120ff996c41"},"headline":"How to Display and Log PHP Errors","datePublished":"2013-01-24T20:29:39+00:00","dateModified":"2022-09-28T14:34:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/"},"wordCount":1164,"commentCount":29,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/01\/website_website-troubleshooting_error_reporting_error-logging-2-report-all.gif","articleSection":["Website","Website Error Numbers"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/","url":"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/","name":"How to Display and Log PHP Errors | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/#primaryimage"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/01\/website_website-troubleshooting_error_reporting_error-logging-2-report-all.gif","datePublished":"2013-01-24T20:29:39+00:00","dateModified":"2022-09-28T14:34:56+00:00","description":"PHP errors can be turned On and Off or logged in a specific file location. This article will discuss how to turn display errors and error logging On for PHP.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/#primaryimage","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/01\/website_website-troubleshooting_error_reporting_error-logging-2-report-all.gif","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2013\/01\/website_website-troubleshooting_error_reporting_error-logging-2-report-all.gif","width":681,"height":324,"caption":"Click here to view the larger image"},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/website\/troubleshoot-php-errors\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to Display and Log PHP Errors"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/0ba9f3ef6fadef71df5aa120ff996c41","name":"InMotion Hosting Contributor","url":"https:\/\/www.inmotionhosting.com\/support\/author\/jamesr\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":null,"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/514","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=514"}],"version-history":[{"count":12,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/514\/revisions"}],"predecessor-version":[{"id":100638,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/514\/revisions\/100638"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=514"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}