Your Complete Guide to Troubleshooting WordPress
I wrote a while back about how to find your error logs for WordPress. We’ve just had a great post on the WPMU DEV support forums adding even more. I’ve decided to combine it, along with my post and with an older post by Sarah to put together your one-stop troubleshooting guide for WordPress. Before you start tearing your hair out, before you start posting frantically on support forums, you can follow this guide to get a handle on what’s gone wrong and how you can fix it.
Here’s what we’ll look at:
- The info you need to provide when reporting an error
- Finding out your PHP version
- Finding Your Error Logs via FTP
- Finding Your Error Logs in Plesk
- Finding Your Error Logs in CPanel
- Common Error Messages and what they mean
- Turn on debugging
- WordPress plugins for getting info about your website
- WordPress plugins for debugging
Let’s get straight to it:
Support Request Information
The information that you provide to make your support request is vital to getting your problem solved quickly. If there isn’t a simple solution to your problem, a support pro will recreate it on their own website. This helps them to work on solving it directly so the more information you provide the better.
Here’s what you need:
- WordPress version
- Plugin and version
- A list of your active plugins
- PHP and server information
- Error log excerpt
- The steps that you took to get the error
All of that information will help with your support request. You’re really doing yourself a favour when you make a support request properly.
Your PHP version could be causing your error. Sometimes web hosts don’t have the latest version of PHP installed. You can upload a file on to your server to get the information you need.
1. Create a text file
You can call it anything you want. For ease let’s call it info.php
2. Add code
Copy and paste this code into it:
<?php phpinfo(); ?>
Add the file to the root of your site on your server:
4. Visit site
Go to: http://yoursite.com/info.php . It should look something like this with your PHP information right at the top:
Finding your Error Logs via FTP
Your error logs have all sorts of goodness that will help you to solve your WordPress problems. There are three common ways to access them. First, let’s take a look at how to access them via FTP:
1. Open your site in your favourite FTP program
2. Navigate to your root folder and check there. If your error log isn’t there you could try wp-includes
Open it up and look for the date and the information that you need.
Finding your Error Logs in Plesk
1. Log into Plesk
2. Look for the Log Manager icon
3. There will be a number of different logs. You want the one called error_log
Finding your Error Logs in CPanel
1. Log in to CPanel
2. Scroll down to Error Log
3. Your error logs will appear there in the reverse order so scroll down to find what you need.
Common Fatal Error Messages and How to Fix Them
- if you have auto installed or upgraded try again manually
- Make sure your plugin or theme works with your version of WordPress
Allowed Memory Size Exhausted
Increase WordPress memory limit by adding this to wp-config.php:
Function already defined
- If you have auto-installed or upgraded try again manually
- If you have created a child theme, make sure you haven’t copied all of the functions from the parent into the child
Turn on Debugging
For more advanced debugging you can add the following to your wp-config.php file. This will give you even more information:
This suggestion from Mike Little on the wp-hackers mailing list, logs all error notices and warnings to a file called debug,log in wp-content. You should add it in the usual place above /* That’s all, stop editing! Happy blogging. */
This will log all errors to a file called debug.log in your wp-content folder. You may need to create the file. To do this:
1. Create a file called “debug.log”
2. Upload the file to wp-content via FTP
3. Open file to check out all of the debugging goodness:
Don’t forget to turn of debugging when you’ve fixed your problem.
WordPress plugins for getting info about your website
WordPress plugins for debugging
Now you should be armed and ready to deal with any problems that you encounter when using WordPress. Have fun!