未加星标

A Step-by-Step Guide to Fix Internal Server Error in WordPress

字体大小 | |
[开发(php) 所属分类 开发(php) | 发布者 店小二05 | 时间 2016 | 作者 红领巾 ] 0人收藏点击收藏

Running a WordPress website? If so, you may have encountered an HTTP 500 Internal Server Error at least once. Unlike other common WordPress errors, the internal server error can be quite annoying since it doesn’t tell you where to look and what to fix.

Despite the fact that we love WordPress, common WordPress errors can drive us crazy be it an unknownphp error, a dreaded white screen of death or an auto-update fail. However, an internal server error is the most common error that often put a WordPress website owner in a panic mode. But relax!

If you have encountered such an error on your website, you are at the right place. In today’s post, I am going to explain what are the causes and solutions of HTTP 500 Internal Server Error.

Causes of Internal Server Error

Well, the matter of the fact is Internal Server Error is not specific to WordPress, it can occur on any website powered by any platform or server. And because of the generic nature of this error, developers usually have no idea how to fix the problem.

It’s basically like asking your doctor to prescribe medication to you without telling them what the problem is.

Having said that there may be certain things that cause this error some of them are:

A Corrupted plugin and/or theme functions A Corrupted .htaccess file can also trigger this problem And an Exhausted PHP memory limit Steps to Fix Internal Server Error

Fixing WordPress internal server error requires a lot of troubleshooting that may mess up your website design or functionality a bit. Therefore, before you plunge into fixing the problem on your website, it is always recommended to backup your website. Since you will be unable to access your WordPress dashboard, you can backup your site using FTP client.

Once you have a backup of your website, you are good to go!

Step 1: Checking the Corrupted .htaccess File
A Step-by-Step Guide to Fix Internal Server Error in WordPress

Htaccess is a hidden plain text file that is stored on the server to control the interaction of your visitors with your site. It can also be used to block certain traffic from being able to access your website. Other functions of the .htaccess file include reconfiguring account settings, creating redirects, setting default pages, rewriting URLs, prohibiting hot links and more.

When trying to fix the internal server error, the first thing you need to do is check for a corrupted .htaccess file. All you have to do is rename your original .htaccess file to .htaccess_old and hit save.

Now refresh your WordPress website and check if the problem persists. If you have regained access to your website, your .htaccess file is corrupted and needs to be replaced with a new one. And if you are still getting an internal server error, move on to the next solution.

Step 2: Increasing the PHP Memory Limit

A majority of time an exhausted PHP Memory limit causes an internal server error on your website. To increase the PHP Memory Limit of your website, follow the steps shown below:

Connect to FTP client using Filezilla or Cyberduck Open your wp-config.php file from the WordPress root directory Add define('WP_MEMORY_LIMIT', '64M'); inside the main PHP tag

However, if you are unable to increase the memory limit with this method, you can try increasing the limit with the following method.

Create a blank text file called php.ini Paste this code in there: memory=64MB Save the file Upload it into your /wp-admin/ folder using FTP

Again check your website if it is fixed. And if it’s fixed, you have basically fixed the error temporarily. Why? Well, there is something that is exhausting your memory limit. It can be a poorly coded theme or plugin or a function. Thus it is highly recommended to contact your hosting provider to know what exactly is causing the memory to exhaust by checking the server logs.

If increasing your memory limit didn’t solve the problem, then you probably need to do some hardcore troubleshooting.

Step 3: Deactivating all plugins
A Step-by-Step Guide to Fix Internal Server Error in WordPress

If nothing works, it’s time to check your plugins. It may be possible that a particular plugin on your website is causing this error or one or two plugins are conflicting with each other. To find out which plugin is causing the internal server error, you need to deactivate all your plugins at once. If you can access your WordPress dashboard, you can easily deactivate your plugins by navigating to installed plugins page and performing a bulk action from the bulk action drop down menu.

However, if you cannot access your site dashboard, you need to connect to your FTP client or open your file manager. Once connected with the FTP client, navigate to /wp-content/folder . Inside this folder, you will notice a folder called plugins. This is where WordPress stores all its plugins and related files. Now to deactivate all plugins at once, you have to rename this folder to plugins_old. This will automatically deactivate all your plugins at once.

Did it fix the problem? If yes, one of your plugins is causing the problem and to find out which plugin is doing so, you need to play a hit and trail method. Start reactivating your plugins one after another from your WordPress dashboard until you find the faulty plugin. Once found, you can replace the plugin with another and report an error to the plugin developer.

Step 4: Re-uploading WordPress Core Files

If the problem still exists, you can try uploading WordPress core files again. This solution is ideal when your website has a corrupt file. Upload wp-admin and wp-includes folder to solve the problem.

Alternatively, you can navigate to WordPress updates and hit re-install now button. Remember you should re-install your WordPress from the WordPress dashboard only.

Step 5: Contacting Your Hosting Server

If everything fails, contact your hosting provider. In a majority of cases, an overloaded server causes the problem. Your hosting provider can better help you understand the problem and resolve it ASAP.

Also, if your website is hosted on a quality hosting provider, you will get support within seconds.

Conclusion:

As mentioned earlier, the internal server error is an annoying error since you never get to know what is causing the error. The troubleshooting it requires is not only time consuming but also risk as you are messing with the core files of the website. However, a little patience and basic knowledge of WordPress can help you solve it quickly.

All in all, it is always a wise idea to keep a backup of your website handy, update your themes and plugins when a new update is available along with the WordPress core.

本文开发(php)相关术语:php代码审计工具 php开发工程师 移动开发者大会 移动互联网开发 web开发工程师 软件开发流程 软件开发工程师

主题: PHPWordSAPRY
分页:12
转载请注明
本文标题:A Step-by-Step Guide to Fix Internal Server Error in WordPress
本站链接:http://www.codesec.net/view/480340.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 开发(php) | 评论(0) | 阅读(32)