{"id":20642,"date":"2020-11-30T04:31:00","date_gmt":"2020-11-29T20:31:00","guid":{"rendered":"https:\/\/web.mwwsb.com.my\/pjci\/?post_type=kb&p=20642"},"modified":"2022-09-08T21:26:53","modified_gmt":"2022-09-08T13:26:53","slug":"how-to-fix-the-500-internal-server-error-on-your-wordpress-website","status":"publish","type":"kb","link":"https:\/\/www.casbay.com\/guide\/kb\/how-to-fix-the-500-internal-server-error-on-your-wordpress-website","title":{"rendered":"How to Fix Internal Server Error on Your WordPress"},"content":{"rendered":"\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

Whenever there is an issue, the 500 internal server error is running on each page of the site. With the server or file system that\u2019s powering your site. The most probable cause is that your WordPress files are located in the root directory. However, an issue may also be trigger on the server of your host.<\/p>

This is one of WordPress \u2018 most frustrating errors. It never has a simple solution; it takes a long time and patience to solve the problems. But we\u2019ll try to help ease this. Some of this stress is by proposing a number of solutions and going through each of you.<\/p>

Let\u2019s get started.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t

Common Solutions for the 500 Internal Server Error<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

The most common reason for this error are a corrupted .htaccess file that exceeds the server\u2019s PHP memory limit. After installing a plugin, the .htaccess file in your WordPress directory can get corrupted or make another change to your WordPress website again. The fix is straightforward. You simply need a new .htaccess file to be created.<\/p>

PHP memory limit issues often occur as the result of a poorly coded plugin. Run-on your website or site, which has grown significantly over time and has too many plugins. When either of these things happens, you will start exceeding the PHP memory limits set by your hosting supplier. The outcome is a 500 internal server error.<\/p>

We will learn how to build a new .htaccess to remove the corrupted one and to check if you exceed your PHP memory limits or not.<\/p>

The .htaccess file<\/a> in your WordPress directory can become corrupted after you install a plugin.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t

Creating a New .htaccess File\n<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

Open your WordPress root directory in FileZilla or your preferred FTP client. This is typically called public_html. If you see folders named wp-admin and wp-content, you\u2019re in the right place. If you don\u2019t see your .htaccess file or any dotfiles, make hidden files viewable by clicking Server and selecting Force Showing Hidden Files<\/em>.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t\t\t

Once you find your .htaccess file, right-click it, and rename it \u201c.htaccess.bak\u201d. This essentially deletes your site\u2019s .htaccess file, so we need to create a new one. Go into your WordPress admin area. Hover over Settings, and select Permalinks. Scroll down to the bottom of the page, and click Save Changes.<\/p>

Open your website in your browser. If the 500 internal server error is gone, it was caused by a corrupted .htaccess file and your problem is now fixed. If you\u2019re still seeing the error, you have some more tests to run.<\/p>

It\u2019s also worth mentioning that an improperly named .htaccess file will cause this error to run on your site. Make sure this file is not named anything other than \u201c.htaccess\u201d.<\/p>

It\u2019s additionally worth bringing up that an improperly named .htaccess file will reason this error to run on your site. Make sure this file is not named something other than \u201c.htaccess\u201d.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t

Increasing Your PHP Memory Limit in WordPress\n<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

PHP memory limits are set by your host and WordPress. WordPress will attempt to increase your limit if you begin exceeding it, but it can only go as high as the limit your host has placed on your server. This limit is often lower for shared hosting plans. You need to increase your PHP memory limit in WordPress and refresh your site to test whether or not this is causing your 500 Internal Server Error.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t\t\t\t\t

Open your root directory and locate your wp-config.php file. Download to your computer by right-clicking on the file. Open the file in your preferred text editor and insert this code bit under the PHP tag:<\/p>

define(‘WP_MEMORY_LIMIT’, ’64M’);
Save the file, and re-upload it to your root directory, overwriting the original file. Refresh the client, and refresh your site. If you still see the error, you are not having PHP memory limit issues. Remove the above code from the wp-config.php file on your computer, save it, and re-upload it to your root directory.<\/p>

Don\u2019t get too excited if you don\u2019t see the error. Regardless you have some work to do.<\/p>

Increasing your site\u2019s PHP memory limit in the wp-config.php file is the equivalent of pouring bleach down your kitchen sink when it smells like rotten eggs. You\u2019re fixing the problem well enough to get rid of the offensive odor, but you\u2019re not fixing the bigger issue at hand, which is likely a clog somewhere in the pipes that lead to your sink.<\/p>

The same is true with increasing your site\u2019s PHP memory limit. You may have increased it yourself in the file, but something is still exhausting your limit. You can follow the steps in the next few sections to try and find out what that might be, but if worst comes to worst, you\u2019ll likely need to convince your host to increase the limit on your server.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t

\n\t\t\t\t
\n\t\t\t

Less Common Solutions for the 500 Internal Server Error<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\t\t

Fixing a corrupted .htaccess file and increasing a site\u2019s PHP memory limit are the top two solutions for fixing this error, if they have not helped you, there are other solutions.<\/p>

They are as follows:<\/p>