{"id":148,"date":"2020-02-12T10:36:44","date_gmt":"2020-02-12T10:36:44","guid":{"rendered":"https:\/\/www.lcn.com\/support\/knowledge-base\/how-to-turn-on-php-error-logging\/"},"modified":"2020-08-14T16:52:26","modified_gmt":"2020-08-14T16:52:26","slug":"how-to-turn-on-php-error-logging","status":"publish","type":"ht_kb","link":"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-on-php-error-logging\/","title":{"rendered":"How to turn on PHP error logging"},"content":{"rendered":"\n<p>Encountering PHP errors is&nbsp;fairly common&nbsp;when using content management systems (CMS) such as WordPress and Joomla, due to third-party plugins and themes being installed and frequently updated.&nbsp;To help diagnose these errors you can use PHP error logging.<\/p>\n\n\n\n<p>Whilst these plugins are usually tested locally, they can conflict with others once live. PHP errors can cause the following issues:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Sitewide warnings or errors&nbsp;<\/li><li>Slowness on the front and backend of the CMS&nbsp;<\/li><li>500 &amp; 503 errors&nbsp;<\/li><li>Restricted access to your control panel&nbsp;&nbsp;<\/li><\/ul>\n\n\n\n<p>To determine the cause of these symptoms,&nbsp;we\u2019d&nbsp;advise turning on PHP error logging to help investigate the cause of the issue. This can be done by following the steps below.&nbsp;<\/p>\n\n\n\n<div class=\"container row col-md-24 support-article panel panel-default panel-body\" style=\"background-color: #f6e9db; border-color: #ead9c7; border: 1px solid #ddd; border-radius: 4px; padding: 1% 2%; background-image: url('\/images\/my_account\/highlight.png'); background-position: left top; background-repeat: repeat-x;\">\n<p><span style=\"font-size: 17px;\"><strong style=\"color: #e77600 !important; font-size: 18px;\">Please&nbsp;note<\/strong>:&nbsp;before you start, you\u2019ll need to know your FTP login details and have an FTP client. If you have not accessed your FTP before,\u202f<a href=\"https:\/\/www.lcn.com\/support\/articles\/how-to-upload-files-to-your-website-with-ftp\/\" target=\"_blank\" rel=\"noreferrer noopener\">this guide<\/a>\u202fwill show you how.&nbsp;&nbsp;<\/span><\/p>\n<\/div>\n\n\n\n<p>Let\u2019s&nbsp;get started\u2026&nbsp;<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Login to your FTP account.&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li>Navigate to the\u202f<strong>\/logs<\/strong>\u202fdirectory.&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li>Create a new file called:\u202f<strong>php.log<\/strong>&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\"><li>Save the php.log file.&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"5\"><li>Navigate to the\u202f<strong>\/web<\/strong>\u202fdirectory.&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"6\"><li>Create a new file called:\u202f<strong>.<\/strong><strong>php<\/strong><strong>.ini<\/strong>&nbsp;<\/li><\/ol>\n\n\n\n<ol class=\"wp-block-list\" start=\"7\"><li>Enter the following text into&nbsp;the\u202f<strong>.<\/strong><strong>php<\/strong><strong>.ini<\/strong>\u202ffile and save.&nbsp;<\/li><\/ol>\n\n\n\n<pre class=\"prettyprint linenums\">log_errors = On<br>error_log =  \/var\/www\/logs\/php.log<br>display_errors = Off\n<\/pre>\n<\/br>\n\n\n\n<p>That\u2019s&nbsp;it!&nbsp;You\u2019ve&nbsp;now successfully turned on PHP error logging.&nbsp;<\/p>\n\n\n\n<div class=\"container row col-md-24 support-article panel panel-default panel-body\" style=\"background-color: #f6e9db; border-color: #ead9c7; border: 1px solid #ddd; border-radius: 4px; padding: 1% 2%; background-image: url('\/images\/my_account\/highlight.png'); background-position: left top; background-repeat: repeat-x;\">\n<p><span style=\"font-size: 17px;\"><strong style=\"color: #e77600 !important; font-size: 18px;\">Please Note:<\/strong>\u202fTo view any PHP errors, navigate to the \/logs directory and open the php.log file. These logs usually indicate the file path of the&nbsp;error;&nbsp;which should help to narrow down any specific plugins or themes causing PHP errors. It advised that you only turn on PHP error logging when it is needed and remove any unneeded logs once you are finished.&nbsp;<\/span><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Encountering PHP errors is&nbsp;fairly common&nbsp;when using content management systems (CMS) such as WordPress and Joomla, due to third-party plugins and themes being installed and frequently updated.&nbsp;To help diagnose these errors you can use PHP error logging. Whilst these plugins are usually tested locally, they can conflict with others once live. PHP errors can cause the [&hellip;]<\/p>\n","protected":false},"author":3,"comment_status":"closed","ping_status":"open","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[4],"ht-kb-tag":[5],"class_list":["post-148","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-managing-web-hosting","ht_kb_tag-web-hosting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to turn on PHP error logging - LCN.com Support Guide<\/title>\n<meta name=\"description\" content=\"How to turn on PHP error logging on your LCN web hosting and WordPress hosting to help you troubleshoot problems with your site.\" \/>\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.lcn.com\/support\/articles\/how-to-turn-on-php-error-logging\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to turn on PHP error logging - LCN.com Support Guide\" \/>\n<meta property=\"og:description\" content=\"How to turn on PHP error logging on your LCN web hosting and WordPress hosting to help you troubleshoot problems with your site.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-on-php-error-logging\/\" \/>\n<meta property=\"og:site_name\" content=\"Customer Support Guides - LCN\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/lcndotcom\" \/>\n<meta property=\"article:modified_time\" content=\"2020-08-14T16:52:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.lcn.com\/support\/wp-content\/uploads\/support-facebook-feed.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@lcndotcom\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-on-php-error-logging\/\",\"url\":\"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-on-php-error-logging\/\",\"name\":\"How to turn on PHP error logging - LCN.com Support Guide\",\"isPartOf\":{\"@id\":\"https:\/\/www.lcn.com\/support\/#website\"},\"datePublished\":\"2020-02-12T10:36:44+00:00\",\"dateModified\":\"2020-08-14T16:52:26+00:00\",\"description\":\"How to turn on PHP error logging on your LCN web hosting and WordPress hosting to help you troubleshoot problems with your site.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-on-php-error-logging\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-on-php-error-logging\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-on-php-error-logging\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.lcn.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to turn on PHP error logging\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.lcn.com\/support\/#website\",\"url\":\"https:\/\/www.lcn.com\/support\/\",\"name\":\"Customer Support Guides - LCN\",\"description\":\"- LCN\",\"publisher\":{\"@id\":\"https:\/\/www.lcn.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.lcn.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.lcn.com\/support\/#organization\",\"name\":\"LCN.com\",\"url\":\"https:\/\/www.lcn.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.lcn.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.lcn.com\/support\/wp-content\/uploads\/2020\/02\/ZF_-hcc3.jpg\",\"contentUrl\":\"https:\/\/www.lcn.com\/support\/wp-content\/uploads\/2020\/02\/ZF_-hcc3.jpg\",\"width\":461,\"height\":461,\"caption\":\"LCN.com\"},\"image\":{\"@id\":\"https:\/\/www.lcn.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/lcndotcom\",\"https:\/\/x.com\/lcndotcom\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to turn on PHP error logging - LCN.com Support Guide","description":"How to turn on PHP error logging on your LCN web hosting and WordPress hosting to help you troubleshoot problems with your site.","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.lcn.com\/support\/articles\/how-to-turn-on-php-error-logging\/","og_locale":"en_US","og_type":"article","og_title":"How to turn on PHP error logging - LCN.com Support Guide","og_description":"How to turn on PHP error logging on your LCN web hosting and WordPress hosting to help you troubleshoot problems with your site.","og_url":"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-on-php-error-logging\/","og_site_name":"Customer Support Guides - LCN","article_publisher":"https:\/\/www.facebook.com\/lcndotcom","article_modified_time":"2020-08-14T16:52:26+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/www.lcn.com\/support\/wp-content\/uploads\/support-facebook-feed.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_site":"@lcndotcom","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-on-php-error-logging\/","url":"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-on-php-error-logging\/","name":"How to turn on PHP error logging - LCN.com Support Guide","isPartOf":{"@id":"https:\/\/www.lcn.com\/support\/#website"},"datePublished":"2020-02-12T10:36:44+00:00","dateModified":"2020-08-14T16:52:26+00:00","description":"How to turn on PHP error logging on your LCN web hosting and WordPress hosting to help you troubleshoot problems with your site.","breadcrumb":{"@id":"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-on-php-error-logging\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.lcn.com\/support\/articles\/how-to-turn-on-php-error-logging\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.lcn.com\/support\/articles\/how-to-turn-on-php-error-logging\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.lcn.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to turn on PHP error logging"}]},{"@type":"WebSite","@id":"https:\/\/www.lcn.com\/support\/#website","url":"https:\/\/www.lcn.com\/support\/","name":"Customer Support Guides - LCN","description":"- LCN","publisher":{"@id":"https:\/\/www.lcn.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.lcn.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.lcn.com\/support\/#organization","name":"LCN.com","url":"https:\/\/www.lcn.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.lcn.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.lcn.com\/support\/wp-content\/uploads\/2020\/02\/ZF_-hcc3.jpg","contentUrl":"https:\/\/www.lcn.com\/support\/wp-content\/uploads\/2020\/02\/ZF_-hcc3.jpg","width":461,"height":461,"caption":"LCN.com"},"image":{"@id":"https:\/\/www.lcn.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/lcndotcom","https:\/\/x.com\/lcndotcom"]}]}},"_links":{"self":[{"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/ht-kb\/148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/comments?post=148"}],"version-history":[{"count":5,"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/ht-kb\/148\/revisions"}],"predecessor-version":[{"id":1255,"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/ht-kb\/148\/revisions\/1255"}],"wp:attachment":[{"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/media?parent=148"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/ht-kb-category?post=148"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.lcn.com\/support\/wp-json\/wp\/v2\/ht-kb-tag?post=148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}