Fatal website errors are quite common. Many times they are not because you’ve done something wrong. When you see a blank screen or a screen full of errors, you may fear that your entire website and all your data is gone. However, that is typically not true. In a matter of minutes you can find the cause and fix it even if you do not have any programming knowledge.
The first thing to do is to relax. This is not the end of the world and the last thing you should do is be in too big a rush to fix it. This can cause even more issues.
Fatal Error Types
Typically there are two types of fatal errors:
- Devastating fatal errors that crash your website resulting in a blank page or a PHP Fatal Error message. The fatal error is persistent through the entire website on both the frontend and backend;
- Occasional fatal errors that occur only on some pages or after performing some action on the website. They also may lead to a blank page or PHP Fatal Error message.
When you have a blank page without any error displayed, this means your server was configured to hide errors. However, they are likely stored in the php_error.log file. Most hosting providers place this file in the root of the website (where index.php file is). If the file is not there, then either contact your hosting provider to clarify where can you find it or check your PHP configuration.
To view your PHP configuration first create and upload a new file with the name phpinfo.php with the lines of code below.
Then type in the browser yourdomainname.com/phpinfo.php. You should see all PHP configurations but your primary interest is the error_log option. It contains the full path to the error log file.
PHP Error Log
Once you have the access to the error log file, you can see what fatal error crashed your website. It should be at the end of the file. A lot of times the fatal errors are self-explanatory based on the error message so you would know exactly what you should be doing to fix the error. However, if you do not understand the error message, then at least determine what plugin or theme caused the error and deactivate it. For example, you might see something like this:
[25-Apr-2017 20:25:52 UTC] PHP Fatal error: Uncaught Error: Call to undefined function is_product() in /www/wp-content/plugins/wp-trouble-plugin/index.php:49
Resolving the PHP Error
In this message you can see that the error was caused by the wp-trouble-plugin so you can simply login via FTP to your server and rename the wp-trouble-plugin to something different. Our recommendation is to put dash or underscore at the beginning of the folder name (i.e. _wp-trouble-plugin). This will prevent WordPress from loading this plugin and your website should come back to normal.
Of course this is not the ideal solution, since your failing plugin is likely important to you. However, this buys you time to research more about the cause. You may even contact the plugin developer and ask for help. It could also be simply because the plugin or theme is out-of-date and the next updated version fixes the error.
If you need help understanding the cause behind the fatal error, do not hesitate to contact our experts. We are more than happy to help you.