How To Fix WordPress Fatal Errors

Are you experiencing “Fatal Error” messages in WordPress? Here are some of the more common WordPress fatal errors you may come across and how to fix these …

How To Fix WordPress Fatal ErrorsThis tutorial is part of our FREE WordPress Management training and WordPress Troubleshooting tutorial series.

In this series of step-by-step tutorials, we show you how to troubleshoot and fix common WordPress errors.

Useful Information

Important: Always back up your WordPress site (files and database) before modifying any files or performing any upgrades or installations! 

If you don’t want to do manual backups, then consider getting assistance from a WordPress professional, or use a backup plugin.

How To Fix WordPress Fatal Errors

Issues with WordPress can result in a number of “fatal error” messages being displayed on your screen. Here are some of the more common WordPress fatal errors you may come across and how to address these:

Fatal Error: Issue With A Plugin

Typically, if an error occurs within a plugin, such as a conflict between an outdated plugin becoming incompatible with a newer version of WordPress for example, you may get a “Fatal Error” message that can affect your entire site …

Fatal Error Message

In the example below, the ‘Fatal error’ clearly indicates that the error is caused by an incompatible plugin, and it also tells you which plugin is causing the error …

Fatal Error Message

To fix this error, all you need to do is deactivate the offending plugin.

To deactivate the plugin, log into your server using FTP or cPanel and locate your WordPress installation’s plugin folder. For this example, we’ll deactivate the plugin using cPanel’s File Manager.

Find the plugin that is causing the error, then select the plugin folder and click rename (if using cPanel’s File Manager – if using FTP, right-click on the file and select ‘Rename’) …

Fatal Error Message

Rename the file by adding anything after the plugin folder name (e.g. ‘old’) and click on ‘Rename File’ …

Fatal Error Message

Confirm that the plugin has been renamed and exit cPanel (or FTP) …

cPanel File Manager

Go back to your browser and refresh or revisit your website’s page. Your site should be restored to normal …

Fatal Error Message

If you log into your site, you may see a message informing you that the plugin has been deactivated due to an error and that the plugin file no longer exists. Refresh your page to dismiss the error message …

Fatal Error Message

Now that you have restored your site to normal, delete the plugin from your site and notify the plugin developer of the error. Hopefully, they will address the problem and issue a new update with a solution.

If you have multiple WordPress sites using the same plugin, remember to check them all to make sure that they are still up and running.

To learn more about errors caused by plugins and how to fix these, go here:

Fatal Error: Call to undefined function

This error means that a plugin or a theme is expecting to find something that isn’t there – hence the undefined function. It could happen for a number of reasons:

  • An error during auto-upgrade. If this happens you should update manually.
  • An error during auto-install. Again, if this happens reinstall manually.
  • A plugin or theme is incompatible with your version of WordPress. This usually happens with older versions of WordPress and new plugins. It may also be that you’re trying to install a plugin that is only compatible with a certain type of setup (e.g. Multisite). If it happens while installing a plugin, disable the plugin using FTP.

To learn more about using FTP and transferring files between your computer and your server, go here:

Fatal Error: Allowed Memory size exhausted

Fatal error: Allowed memory size exhausted

(Fatal error: Allowed memory size exhausted)

This error occurs when the amount of memory allocated to WordPress isn’t enough to perform the task required by a feature or plugin that you have installed on your site. Hosts normally set a server limit for PHP memory to one of the following amounts: 32, 64, 128, 256, or 512 MB.

Note: Exceeding your PHP memory limit can also lead to a 500 Internal Server Error.

To fix this error you need to increase the amount of memory that WordPress can use. To do this you will need to either edit your wp-config.php file or your php.ini file.

Edit wp-config.php File

The wp-config.php file is located in your WordPress installation directory and can be accessed via FTP or using cPanel’s File Manager …

wp-config.php file

(wp-config.php file)

If you need help accessing files on your server, refer to the tutorial below:

To edit wp-config.php, download the file to your hard drive, then open up the file using a plain text editor and add the following line:

WordPress Troubleshooting… or change the current setting to a higher limit (e.g. ‘256’ or ‘512’) …

Increase memory limit in your wp-config.php file

(Increase memory limit in your wp-config.php file)

After editing and resaving your wp-config.php file, reupload the file to your server overwriting the existing file.

Edit php.ini File

Editing your php.ini file is a bit more complicated as it’s not a file that comes with WordPress but is part of your hosting account.

A php.ini file is the default file for configuring and running applications that require PHP. The server looks for this file when PHP starts up for instructions on how to control variables such as upload sizes, file timeouts, and resource limits.

If your server contains a php.ini file, you can access it using FTP or cPanel’s File Manager …

php.ini

(php.ini)

Download a copy of your php.ini file to your hard drive, then open it using a plain text editor …

Open your php.ini file using a plain text editor

(Open your php.ini file using a plain text editor)

Note: To locate and open the php.ini file in your plain text editor, make sure that ‘All files (*.*)’ is selected in the ‘Files of type:’ drop-down menu.

This file should contain a simple instruction for setting the PHP memory limit …

PHP memory limit

(PHP memory limit)

Increase the memory limit amount (e.g. from 64M to 128M or 256M) …

Increase PHP memory limit amount

(Increase PHP memory limit amount)

Resave the php.ini file and reupload the file to your server overwriting the existing file.

If you don’t have access to your php.ini file, contact your hosting provider to make changes, or see this tutorial:

You may also want to try adding the line of code below to your .htaccess file and see if this fixes the problem:

Troubleshootimg WordPress

Fatal error: Maximum execution time

Open up your wp-config.php file and add the following line:

set_time_limit(0);

You can add the line shown above anywhere in the file, even right after the opening comment block, as shown in the example below:

WordPress Troubleshooting Tutorials

After making the adjustment, retry the automatic update.

How To Fix WordPress Errors – Videos

In addition to the information above, here are a couple of videos on how to fix WordPress “fatal” errors from the team at MyThemeShop:

How To Fix WordPress Memory Exhausted Error

(How to fix WordPress memory exhausted error. Video: MyThemeShop)

How To Fix WordPress Fatal Error: Maximum Execution Time Exceeded

(How to fix WordPress fatal error: Maximum execution time exceeded. Video: MyThemeShop)

More WordPress Troubleshooting Tutorials

If you experience additional issues or errors with WordPress, please see the tutorials in the section below:

How To Fix WordPress Fatal Errors

(Source: Pixabay)

***

"I love the way your email series "Infinite Web Content Creation Training Series" is documented and presented. It is very absorbing and captivating. The links and tutorials are interesting and educational. This has motivated me to rewrite my content following the concepts I am learning from the email series." - Mani Raju, www.fortuneinewaste.com

***

Originally published as How To Fix WordPress Fatal Errors.