Debugging Errors on WordPress & Viewing Logs

Last Updated -


For issues relating to the "Error Rendering Page." like below:

 


With SSH/terminal access:

SSH into the VPS via Terminal

Then run the command below to view most recent PHP errors:

$ pagely error:php ~/sites/sitename.com

To tail the error log live, as errors are occurring:

$ pagely error:php ~/sites/sitename.com --follow

Then reload the error page in the browser & the terminal output should show the line.


With sFTP access only:

Add the following code to the top of the wp-config.php file.

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

The error log will then be viewable in a browser at the http://sitename.com/wp-content/debug.log URL, or through sFTP at the /wp-content/debug.log location.

  • When finished debugging:
    • Comment or remove the lines added above to the wp-config.php file.
    • The system will automatically remove the debug.log file for you shortly after so you don't need to worry about it.
    • If you are concerned with leaving this available since it is publicly accessible you can delete the /wp-content/debug.log file through sFTP.

Bypassing our error page:

We cannot disable the error page, but you can bypass it to see what errors are poping up.

Add the following code to the top of the wp-config.php file:

if (false !== strpos($_SERVER['REQUEST_URI'], 'debug')) {
    define('WP_DEBUG', true);
}

To view the error, add /?debug to the end of the URL that's erroring out.

Related Topics

  • Go Live
    When you are ready to make you site live (See pointing traffic to Pagely) on your actual domain, do the following. 1....

  • 2-Factor Authentication
    We have recently added 2FA to all Pagely Atomic accounts. [What is 2FA]  2FA adds another layer of security to your ...

  • Temporary Server Resizes
    NOTE: Please note this article is for our customers on a VBURST-2 or higher plan. We do not support temporary resizes...

  • Image Editors - using Imagick over GD
      What are Imagick and GD? Imagick and GD are popular Image optimization libraries in PHP applications. Are both Imag...

  • Your guide to Pagely's NGINX+Apache and NGINX-only modes
    Pagely supports two different webserver modes. The default mode is NGINX+Apache. There is another mode we refer to as...

  • EU Data Policies
    The following article is geared towards our VPS and higher plans. Shared sites and backups are hosted in our Virginia...

  • PHP 7 Server Rebuild FAQs
    The following FAQs cover some important details to be aware of when Pagely rebuilds your VPS in order to get PHP 7. P...

  • VPS Server Visitor Capacity and Temporary Resize FAQs
    How many concurrent users could we support on 1 site? This depends highly on the type of traffic and whether or not i...

  • EWWW Image Optimizer Plugin
    You may see the following error when using the EWWW plugin: EWWW Image Optimizer requires exec(). Your system adminis...

  • How send traffic through our UK DC
    Pagely has content cache nodes in Ireland.  To use them point your CNAME to global.pagelyhosting.com. This dns endpoi...

Pagely is the Managed WordPress Hosting Platform designed to exceed the needs of media, business, and Enterprise customers alike. We help the world's biggest brands scale WordPress.

Copyright © 2006-2016 Pagely, Inc. All rights reserved.
Pagely® and WordPress® are registered trademarks.

Pagely
Powered by Zendesk