Got a fatal error while trying to activate a plugin?
This article will help you solve it.
A fatal error can happen anytime due to errors like theme and plugin conflict, outdated plugins, and PHP configuration malfunction. It’s more common than you think.
Fortunately, fatal errors are informative. The error warnings always include the reason behind the error. What exactly caused it.
Which makes it pretty easy to fix.
Here’s how the warning of plugin could not be activated because it triggered a fatal error looks like:
In this case, we got ” fatal error: uncaught “. A plugin conflicted with a WordPress hook and the software refused to activate the plugin.
There’s are several ways you can fix this depending on different situations.
1. Deactivate All The Plugins
If the error keeps coming whenever you try to install a plugin, deactivate all the plugins installed on your WordPress website.
Activate each plugin one by one until you find who’s the culprit.
If you cannot get access to your WordPress admin panel, use an FTP client such as FileZilla to gain access to your server.
Find the wp-content directory (located below wp-admin) and then click on the plugins folder.
To deactivate plugins, change their name slightly. For instance, add 00 at the end of each plugin name.
This way plugins won’t get deleted and you won’t have to waste your time re-installing them.
2. Increase PHP Execution & Memory Limit
If you are getting an error saying: maximum execution time exceeded, try this step.
WordPress works on PHP, well mostly. To make sure everything runs smoothly and cost-efficiently, there are restrictions on both memory and execution time.
Shared web hosts have a much lower range than managed web hosts.
Add the following code to your .htaccess file:
php_value max_execution_time 300
To find your .htaccess file, use an FTP client like FileZilla. You’ll find .htaccess in public_html file. Take a look at the image below for reference:
If you’ve installed Yoast SEO, you can alternatively use its file editor to edit .htaccess file. Go to Yoast settings and click on tools:
There you’ll have an option to use the file editor.
The next step is to increase the PHP memory. Add the following code to your wp-config.php file:
define('WP_MEMORY_LIMIT','128M');
To edit the wp-config.php file, log into your FTP server. Again, you’ll have to use FTP client FileZilla.
Youll find the wp-config.php file under the public folder. Take a look at the image below for reference:
Once you’ve tried both of these steps clear the browser cache and refresh your WordPress dashboard.
Thankfully, this error sometimes resolves quickly. You should check this guide of you can’t log in to your WordPress dashboard.
I hope this guide has helped to fix the fatal error and now you’re able to activate the plugin you want.
Let me know which method worked for you.
usman hayat
really informative and concise, insightful.