{"id":658,"date":"2019-11-20T21:53:35","date_gmt":"2019-11-20T14:53:35","guid":{"rendered":"https:\/\/lab.wptips.dev\/?p=658"},"modified":"2020-06-01T22:20:01","modified_gmt":"2020-06-01T15:20:01","slug":"fix-internal-server-error","status":"publish","type":"post","link":"https:\/\/pixelstudio.id\/blog\/fix-internal-server-error\/","title":{"rendered":"How to Fix 500 Internal Server Error"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"329\" src=\"https:\/\/pixelstudio.id\/blog\/wp-content\/uploads\/2019\/11\/fix-ise-messasge.jpg\" alt=\"\" class=\"wp-image-805\" srcset=\"https:\/\/pixelstudio.id\/blog\/wp-content\/uploads\/2019\/11\/fix-ise-messasge.jpg 750w, https:\/\/pixelstudio.id\/blog\/wp-content\/uploads\/2019\/11\/fix-ise-messasge-480x211.jpg 480w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><figcaption>The Message you see when getting Internal Server Error<\/figcaption><\/figure><\/div>\n\n\n\n<p>500 Internal Server Error is tricky. They never tell you the reason. Just like that one friend who suddenly avoiding you.<\/p>\n\n\n\n<p>No matter what it is, the cause has to be recent. So think back of what you just changed or installed.<\/p>\n\n\n\n<p>If you are not sure, here are two common causes of Internal Server error:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Faulty htaccess File<\/h2>\n\n\n\n<p>HTAcess is a server configuration file. Some plugin like W3 Total Cache automatically edits this upon activation and may cause error.<\/p>\n\n\n\n<p>This is the <strong>first thing you should check<\/strong>. Launch your FTP like Filezilla and you can find the file in the root directory of your project:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"404\" src=\"https:\/\/pixelstudio.id\/blog\/wp-content\/uploads\/2019\/11\/fix-ise-htaccess.jpg\" alt=\"\" class=\"wp-image-806\" srcset=\"https:\/\/pixelstudio.id\/blog\/wp-content\/uploads\/2019\/11\/fix-ise-htaccess.jpg 750w, https:\/\/pixelstudio.id\/blog\/wp-content\/uploads\/2019\/11\/fix-ise-htaccess-480x259.jpg 480w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><figcaption>Use FTP to edit .htaccess<\/figcaption><\/figure><\/div>\n\n\n\n<p>Try reverting your<code>.htaccess<\/code> to the <strong>default config<\/strong> listed below. If it&#8217;s fixed, then you can proceed to figure out what&#8217;s wrong with the previous config.<\/p>\n\n\n\n<pre title=\".htaccess (Single Site)\" class=\"wp-block-code\"><code lang=\"\" class=\"\"># BEGIN WordPress\n\nRewriteEngine On\nRewriteBase \/\nRewriteRule ^index\\.php$ - [L]\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule . \/index.php [L]\n\n# END WordPress<\/code><\/pre>\n\n\n\n<pre title=\".htaccess (Multisite Subdirectory)\" class=\"wp-block-code\"><code lang=\"\" class=\"\">RewriteEngine On\nRewriteBase \/\nRewriteRule ^index\\.php$ - [L]\n\n# add a trailing slash to \/wp-admin\nRewriteRule ^([_0-9a-zA-Z-]+\/)?wp-admin$ $1wp-admin\/ [R=301,L]\n\nRewriteCond %{REQUEST_FILENAME} -f [OR]\nRewriteCond %{REQUEST_FILENAME} -d\nRewriteRule ^ - [L]\nRewriteRule ^([_0-9a-zA-Z-]+\/)?(wp-(content|admin|includes).*) $2 [L]\nRewriteRule ^([_0-9a-zA-Z-]+\/)?(.*\\.php)$ $2 [L]\nRewriteRule . index.php [L]<\/code><\/pre>\n\n\n\n<pre title=\".htaccess (Multisite Subdomain)\" class=\"wp-block-code\"><code lang=\"\" class=\"\">RewriteEngine On\nRewriteBase \/\nRewriteRule ^index\\.php$ - [L]\n\n# add a trailing slash to \/wp-admin\nRewriteRule ^wp-admin$ wp-admin\/ [R=301,L]\n\nRewriteCond %{REQUEST_FILENAME} -f [OR]\nRewriteCond %{REQUEST_FILENAME} -d\nRewriteRule ^ - [L]\nRewriteRule ^(wp-(content|admin|includes).*) $1 [L]\nRewriteRule ^(.*\\.php)$ $1 [L]\nRewriteRule . index.php [L]<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">2. Out of Memory<\/h2>\n\n\n\n<p>A typical WordPress site rarely ran out of memory, so if one does, it needs serious optimization.   Of course you can simply increase the limit by adding this code in WP Config, but we don&#8217;t recommend it:<\/p>\n\n\n\n<pre title=\"wp-config.php\" class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">...\ndefine( 'WP_MEMORY_LIMIT', '256M' );\n...<\/code><\/pre>\n\n\n\n<p>Here are 4 methods to <strong>optimize your site<\/strong> ordered from highest to lowest priority:<\/p>\n\n\n\n<ol><li><strong>Use Cache plugin<\/strong><br>Cache is a temporary copy of your site. So instead of loading from database when someone visits, it serves this copy. The plugin I like the most is <a href=\"https:\/\/pixelstudio.id\/blog\/best-setting-for-w3-total-cache\/\">W3 Total Cache<\/a>.<\/li><li><strong>Compress Images<\/strong><br>Use image optimizer plugin like <a rel=\"noreferrer noopener\" aria-label=\"EWWW (opens in a new tab)\" href=\"https:\/\/wordpress.org\/plugins\/ewww-image-optimizer\/\" target=\"_blank\">EWWW<\/a>. The file size will become lower at the cost of slight quality, but mostly unnoticeable.<\/li><li><strong>Connect to <a href=\"https:\/\/www.cloudflare.com\/\">Cloudflare<\/a><\/strong><br>It&#8217;s a 3rd party service to help secure and speed up your site, which mean it reduces the stress from your server.<\/li><li>(Last resort) <strong>Migrate to a better hosting<\/strong><br>Check the specs of your current hosting. I used a plan in <a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/www.webfaction.com\/?aid=41241\" target=\"_blank\">Webfaction<\/a> with 512 MB Memory and it can easily handle 10+ sites.<\/li><\/ol>\n\n\n\n<hr class=\"wp-block-separator is-style-dots\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>In my experience, the only cause of Internal Server Error is either faulty<code>.htaccess<\/code> or lack of memory.<\/p>\n\n\n\n<p>Corrupted theme, plugins, or WordPress core can only trigger a standard <strong>Fatal Error<\/strong> that shows you what the error is and in which file.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>Feel free to share your experience with Internal Server Error in the comment below \ud83d\ude42<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>This error never tell you the reason just like that one friend who suddenly avoiding you. No matter what it is, the cause has to be recent. So think back of what you just changed or installed.<\/p>\n","protected":false},"author":1,"featured_media":807,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[38],"class_list":["post-658","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-general","tag-server"],"blocksy_meta":{"page_structure_type":"default","page_enable_vertical_spacing":"yes","has_hero_section":"default","hero_section":"type-1","hero_alignment1":"left","hero_alignment2":"center","hero_height":"230px","page_title_bg_type":"color","bdfa4a8df42cfd151192bb9c156564dc":"","custom_hero_background":{"attachment_id":null},"parallax":{"desktop":false,"tablet":false,"mobile":false},"single_meta_elements":{"author":true,"date":true,"categories":true,"comments":true,"updated":false,"tags":false},"has_meta_label":"yes","single_meta_date_format":"M j, Y","page_excerpt_visibility":{"desktop":true,"tablet":true,"mobile":false},"pageTitleFont":{"family":"Default","variation":"n7","size":{"desktop":"32px","tablet":"30px","mobile":"25px"},"line-height":"1.3","letter-spacing":"0em","text-transform":"none","text-decoration":"none"},"pageTitleFontColor":{"default":{"color":"var(--paletteColor4)"}},"pageMetaFont":{"family":"Default","variation":"n6","size":{"desktop":"12px","tablet":"12px","mobile":"12px"},"line-height":"1.3","letter-spacing":"0em","text-transform":"uppercase","text-decoration":"none"},"pageMetaFontColor":{"default":{"color":"CT_CSS_SKIP_RULEDEFAULT"},"hover":{"color":"CT_CSS_SKIP_RULEDEFAULT"}},"pageExcerptFont":{"family":"Default","variation":"n5","size":"17px","line-height":"1.65","letter-spacing":"0em","text-transform":"none","text-decoration":"none"},"pageExcerptColor":{"default":{"color":"CT_CSS_SKIP_RULEDEFAULT"}},"pageTitleOverlay":{"default":{"color":"rgba(41, 51, 60, 0.2)"}},"pageTitleBackground":{"default":{"color":"#EDEFF2"}},"167181ae3d13e1d3fd5f7dc06d6cf014":"","6dd286f6a7d4af08aa8cf1cfedeb41b5":"","f675e8b397023f98ec3dc65c8fec1dc1":"","6e56657a8cbd4810064d15f8c22c9f6c":"","9f01b1231048a227644f348a03b8e626":"","5b1f7346543cb017f87cd0cc781c6a2b":"","058eaf8fcab1cf36a3cd5ec406eca6f4":"","0d20c91e514fda7b1817569357f2781c":"","b3998fdb58247c807c7acd2ecb72cda6":"","aa79ee454dddcdbea3acb438ebe0c5ae":"","eb8f16c11d7778f840db60a81cadf21d":"","date_format_source":"custom","3e7c590dacd4df376c74b769041c285e":"","f76cb8c59c0f3173558d816215643847":"","a9de12656426371c8c04ce5ac90e3387":"","46508c243fa03756555d7babb9d9b7db":""},"_links":{"self":[{"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/posts\/658","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/comments?post=658"}],"version-history":[{"count":10,"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/posts\/658\/revisions"}],"predecessor-version":[{"id":1517,"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/posts\/658\/revisions\/1517"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/media\/807"}],"wp:attachment":[{"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/media?parent=658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/categories?post=658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pixelstudio.id\/blog\/wp-json\/wp\/v2\/tags?post=658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}