Well, many reasons may casue this error, some maybe related to the theme while others not, anyway, here you can find the major reasons for this error:
- Problem in the web server configuration
Whether your web server is running Apache, nginx or IIS, any incorrect configuration may casue this error, so in case you are running your website on a VPS that you can manage, we recommend having a look on your server configuration settings.
Most probably you are hosting your website on a shared hosting, or your VPS is managed by any hosting/server-management company, in 99.9% of cases the company will blame the software installed for such an error, so please go throw other recommenditions below beofre contacting them regrading this issue.
- Incorrect file permissions
In general all your WordPress script, themes and plugins permissions need to be set at 755 for folders, and 644 for files. Setting permissions either too strict or too loose often cause this and other errors.
- Corrupt files or files that contain errors in code
And this file maybe:
- .htaccess file
In this case, all you need to do is connecting to your website using any FTP client, and downaloading your current .htaccess file in your root directory, then delete it on your server and create a blank one.
At this stage if this error is cuased by .htaccess, you will have access to WordPress Admain panel at “yoursite.com/wp-admin” and once logged in go to (Settings >> Permalinks >> Save Changes) to regenerate .htaccess rules.
- One of your plugins files
If it was one of your plugins files, then you should try deactivating all your plugins and re-check this issue, as long as you can't access WordPress admin panel to deactivate all your plugins, you will need to deacttivate theme throw FTP.
Simple, navigate to this directory (/wp-content/) and change the plugins folder name to anything like “plugins-old” for example.
If this works, then after you log-in to WordPress admin panel, rename the plugins folder name back to its default name “plugins” and you will see all your plugins came back to your WordPress panel, now try to re-activate them ony by one till you know which one is causing this issue.
- In the theme
Maybe this corrupted file is related to the theme, to exclude this assumption try to delete your current theme files and re-upload a fresh new copy of recent theme files directly downloaded from ThemeForest website.
- Related to the WordPress script files itself
Although this maybe sounds weird, but YES it happens, in this case you will need to replace your current WordPress script files/folders with a pure copy downloaded from wordpress.org website, NOTE that you don't need to replace/delete your current (/wp-content) folder, as it contains all your images/uploads/plugins and of course you don't want to lose it.
- PHP memory limits set too low
Then you will need to contact your web hositng company to increase the PHP memory limit for you, or simply add this line in wp-config.php file: