In this article we will be walking you through the steps required to successfully diagnose and debug a 500 error. 500 errors can be a pain but if you go through this guide you will be able to address them and that will give you enough information to fix them. Below are the three things that you will need to accomplish this.
- SFTP credentials
- SFTP client
- Text Editor
500 errors can trigger on both on the frontend as well as the backend. The first thing you need to know about 500 errors is that it is an indicator of some error in code. The debug log provides you specific details of the error; we are going to be looking for “fatal” errors.
Below is a sample of what a 500 error may look like in your browser.
In order to access your debug log you will need to first turn on debugging and then access the debug log. If you don’t already have access to your site via SFTP, log into your my.pressable.com account. There you will find a tab named “Users/FTP”.
Once you are on that page, you will see something similar to what you see below. Note the information you will need is as follows: the URL, Port, Username, and Password (to get the password, click on the Reset Password). This information will be needed if to access your site via SFTP.
If order to access your site via SFTP you will need an FTP client – we recommend using Filezilla, which is offered for both Windows and OS X. Find it here https://filezilla-project.org/. Once you install it you will see something like you see below. When you see that, enter the information you got from your my.pressable.com page and click Quickconnect.
Once you have logged in you will see something similar to what you see below. Click on the folder “htdocs”.
Once you are in that folder you will need to access the file called “wp-config.php”. You will need to right-click on it and select “View/Edit”. This will download the file. After that it should open the wp-config file in your defualt text editor. You will need scroll down and find the section that is pictured below. By default your debug log will be set to false. You will need to change that text to “true”. Be sure to NOT edit anything else in that document as it can render your site unusable. Once you have saved the file, upload it to the same directory by just dragging that file in the directory to overwrite the previous one.
When this happens, this tells WordPress to start logging any errors in code as they happen. At this point you want to go and recreate the behavior that caused this 500 error. Once you do this, that error is immediately logged to the debug file. To view it, go back to your FTP client and navigate to a folder called “wp-content”.
Assuming the error was successfully logged, it will create a file called “debug.log”. This is where you will find the errors. Right-click on this file and hit “View/Edit” which will download that the text file to your computer.
Once you have the file open you will see something like you see below. You are going to look for errors that will contain the word “Fatal”.
A fatal error will most likely be the source of the 500 error. You may see other errors like “notices” or “warnings” – these will not necessarily cause the functionality of your website to be affected, but they should still be addressed.
The above is an example of a debug.log file. The two things that you should look for to really diagnose the problem are as follows: The arrow on the left shows the kind of error – this is where you would see a fatal error if you are having a grave problem. The arrow on the right is the location of the file that contains the error. Most of the time it will be an error with either a plugin or a theme. At that point, you want to fix that. If you are not sure how to, contact the developer who created that plugin or theme and they should be able to help you out. In the meantime, it would be a good idea to deactivate that plugin and/or theme untill you get it resolved.
Hopefully this will help you diagnose those pesky 500 errors. If you have any further questions, please submit a ticket via your my.pressable.com control panel.