{"id":4278,"date":"2020-02-28T13:32:19","date_gmt":"2020-02-28T06:32:19","guid":{"rendered":"https:\/\/tino.vn\/?post_type=ht_kb&#038;p=4278"},"modified":"2021-06-14T22:57:19","modified_gmt":"2021-06-14T15:57:19","slug":"fix-loi-internal-server-error-tren-wordpress","status":"publish","type":"ht_kb","link":"https:\/\/tino.vn\/blog\/docs\/fix-loi-internal-server-error-tren-wordpress\/","title":{"rendered":"Fix l\u1ed7i Internal Server Error tr\u00ean WordPress"},"content":{"rendered":"<p>V\u1ec1 c\u01a1 b\u1ea3n website ch\u00ednh l\u00e0 m\u1ed9t ph\u1ea7n m\u1ec1m \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef tr\u00ean m\u00e1y ch\u1ee7 v\u00e0 \u0111\u01b0\u1ee3c thi\u1ebft k\u1ebf b\u1edfi c\u00e1c d\u00f2ng l\u1ec7nh, Website chia l\u00e0m 2 ph\u1ea7n ch\u00ednh l\u00e0 b\u1ed9 code (l\u00e0 ph\u1ea7n khung) v\u00e0 \u0111\u01b0\u1ee3c k\u1ebft n\u1ed1i v\u1edbi database (d\u1eef li\u1ec7u trang web). Trong qu\u00e1 tr\u00ecnh v\u1eadn h\u00e0nh kh\u00f4ng th\u1ec3 tr\u00e1nh kh\u1ecfi nh\u1eefng l\u1ed7i g\u00e2y d\u00e1n \u0111o\u1ea1n trang web v\u00e0 ng\u01b0\u1eddi \u0111\u1ecdc n\u00f3 c\u00f3 th\u1ec3 s\u1ebd kh\u00f4ng truy c\u1eadp v\u00e0o website \u0111\u01b0\u1ee3c. Website WordPress c\u0169ng v\u1eady, m\u1ed9t s\u1ed1 l\u1ed7i th\u01b0\u1eddng g\u1eb7p l\u00e0\u00a0<strong>l\u1ed7i 404<\/strong>\u00a0ho\u1eb7c\u00a0<strong>l\u1ed7i 403<\/strong>\u00a0hay\u00a0<strong>l\u1ed7i HTTP 500 Internal Server Error<\/strong><\/p>\n<p>\u1ede b\u00e0i vi\u1ebft tr\u01b0\u1edbc t\u00f4i \u0111\u00e3 chia s\u1ebb\u00a0<strong>kh\u1eafc ph\u1ee5c l\u1ed7i 404 trong wordpress <\/strong>v\u00e0 trong b\u00e0i n\u00e0y ch\u00fang ta c\u00f9ng th\u1ea3o lu\u1eadn v\u1ec1\u00a0<strong>c\u00e1ch kh\u1eafc ph\u1ee5c l\u1ed7i HTTP 500 Internal Server Error trong WordPress.<\/strong><\/p>\n<p>C\u00f3 nhi\u1ec1u nguy\u00ean nh\u00e2n d\u1eabn \u0111\u1ebfn l\u1ed7i n\u00e0y, v\u00e0 r\u1ea5t kh\u00f3 kh\u0103n \u0111\u1ec3 bi\u1ebft \u0111\u01b0\u1ee3c ch\u00ednh x\u00e1c l\u1ed7i n\u00e0y t\u1eeb \u0111\u00e2u x\u1ea3y ra. \u0110\u1ec3 gi\u00fap c\u00e1c b\u1ea1n c\u00f3 th\u1ec3 d\u1ec5 d\u00e0ng h\u00ecnh dung, ch\u00fang ta h\u00e3y c\u00f9ng t\u00ecm hi\u1ec3u nguy\u00ean nh\u00e2n v\u00e0 t\u1eeb \u0111\u00f3 t\u00ecm ra ph\u01b0\u01a1ng ph\u00e1p chung \u0111\u1ec3 kh\u1eafc ph\u1ee5c.<\/p>\n<p><strong>Nguy\u00ean nh\u00e2n l\u1ed7i HTTP 500 Internal Server Error?<\/strong><br \/>\nHTTP 500 Internal Server Error c\u00f3 th\u1ec3 x\u1ea3y ra tr\u00ean b\u1ea5t k\u1ef3 tr\u00ecnh duy\u1ec7t, h\u1ec7 \u0111i\u1ec1u h\u00e0nh n\u00e0o, v\u00e0 b\u1ea5t k\u1ef3 trang web, kh\u00f4ng ch\u1ec9 \u1edf c\u00e1c trang web WordPress. N\u00f3 x\u1ea3y ra khi kh\u00f4ng c\u00f3 th\u00f4ng b\u00e1o c\u1ee5 th\u1ec3 n\u00e0o, gi\u1ed1ng nh\u01b0 h\u00ecnh \u1ea3nh sau:<\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-2373 aligncenter\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2020\/02\/http-500-error-showcase.png\" alt=\"http-500-error-showcase\" width=\"690\" height=\"295\" title=\"\"><br \/>\nTh\u00f4ng th\u01b0\u1eddng khi m\u1ed9t trang web x\u1ea3y ra l\u1ed7i \u0111\u1ec1u hi\u1ec3n th\u1ecb l\u00ean nh\u1eefng v\u1ea5n \u0111\u1ec1 li\u00ean quan \u0111\u1ebfn l\u1ed7i \u0111\u00f3, tuy nhi\u00ean l\u1ed7i n\u00e0y kh\u00e1 chung chung, v\u00e0 tr\u00ecnh duy\u1ec7t kh\u00f4ng hi\u1ec3n th\u1ecb l\u00ean l\u1ed7i n\u00e0y l\u00e0 do \u0111\u00e2u, trong WordPress ch\u00fang ta c\u00f3 th\u1ec3 x\u00e1c nh\u1eadn l\u00e0 do m\u1ed9t trong c\u00e1c nguy\u00ean nh\u00e2n sau:<br \/>\n\u2013 H\u1ecfng t\u1eadp tin .htaccess<br \/>\n\u2013 Do xung \u0111\u1ed9t Plugin<br \/>\n\u2013 Do gi\u1edbi h\u1ea1n b\u1ed9 nh\u1edb PHP<br \/>\n\u2013 L\u1ed7i ph\u1ea7n m\u1ec1m m\u00e1y ch\u1ee7 web nh\u01b0 Apache, PHP\u2026<br \/>\n\u2013 Do m\u00e1y ch\u1ee7 qu\u00e1 t\u1ea3i.<\/p>\n<p><strong>L\u00e0m th\u1ebf n\u00e0o \u0111\u1ec3 s\u1eeda l\u1ed7i HTTP 500 Internal Server Error?<\/strong><\/p>\n<p><strong># ki\u1ec3m tra t\u1eadp tin .htaccess<\/strong><\/p>\n<p>H\u1ecfng t\u1eadp tin .htaccess l\u00e0 nguy\u00ean nh\u00e2n kh\u1ea3 d\u0129 nh\u1ea5t c\u1ee7a HTTP 500 Error. \u0110\u1ec3 kh\u1eafc ph\u1ee5c l\u1ed7i n\u00e0y, \u0111\u1ea7u ti\u00ean b\u1ea1n c\u00f3 th\u1ec3 ki\u1ec3m tra c\u00e1c t\u1eadp tin b\u1eb1ng c\u00e1ch \u0111\u1ed5i t\u00ean t\u1eadp tin .htaccess v\u1edbi m\u1ed9t t\u00ean m\u1edbi. B\u1ea1n c\u00f3 th\u1ec3 t\u00ecm th\u1ea5y c\u00e1c t\u1eadp tin b\u1eb1ng c\u00e1ch \u0111\u0103ng nh\u1eadp v\u00e0o b\u1ea3ng \u0111i\u1ec1u khi\u1ec3n c\u1ee7a m\u00e1y ch\u1ee7 ho\u1eb7c th\u00f4ng qua FTP client.<\/p>\n<p>\u0110\u0103ng nh\u1eadp v\u00e0o cPanel v\u00e0 nh\u1ea5p v\u00e0o bi\u1ec3u t\u01b0\u1ee3ng File Manager trong ph\u1ea7n Files. T\u00ecm t\u1edbi th\u01b0 m\u1ee5c ch\u1ee9a code website c\u1ee7a b\u1ea1n.<\/p>\n<p><a href=\"https:\/\/www.screencast.com\/t\/VQJItt97DXbo\" rel=\"nofollow noopener\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/content.screencast.com\/users\/JohnGrayWorld\/folders\/Snagit\/media\/9564ef3a-decf-473f-a780-c9ced96cc27f\/02.28.2020-13.31.png?source=oembed\" alt=\"02.28.2020-13.31.18\" width=\"500\" height=\"291\" title=\"\"><\/a><\/p>\n<p>Sau \u0111\u00f3 t\u00ecm \u0111\u1ebfn t\u1eadp tin .htaccess v\u00e0 b\u1ea5m chu\u1ed9t ph\u1ea3i v\u00e0o v\u00e0 ch\u1ecdn rename \u0111\u1ec3 \u0111\u1ed5i ti\u00ean file n\u00e0y.<\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-2377 aligncenter\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2020\/02\/rename-htaccess-fiel.jpg\" alt=\"rename-htaccess-fiel\" width=\"467\" height=\"352\" title=\"\">L\u00fac n\u00e0y trang web c\u1ee7a b\u1ea1n c\u00f3 th\u1ec3 s\u1ebd kh\u00f4ng \u0111\u01b0\u1ee3c ho\u1ea1t \u0111\u1ed9ng n\u1eefa, v\u00e0 b\u1ea1n c\u1ea7n ph\u1ea3i t\u1ea1o ra m\u1ed9t file .htaccess ho\u00e0n to\u00e0n m\u1edbi theo \u0111\u00fang chu\u1ea9n b\u1eb1ng c\u00e1ch v\u00e0o\u00a0<strong>WordPress Dashboard -&gt; Settings -&gt; Permalinks<\/strong>\u00a0v\u00e0 nh\u1ea5p v\u00e0o n\u00fat Save. B\u1eb1ng c\u00e1ch n\u00e0y, b\u1ea1n WordPress t\u1ea1o m\u1ed9t t\u1eadp tin .htaccess m\u1edbi v\u1edbi quy t\u1eafc vi\u1ebft l\u1ea1i \u0111\u00fang.<\/p>\n<p><strong># Xung \u0111\u1ed9t Plugin<\/strong><\/p>\n<p>N\u1ebfu c\u1eadp nh\u1eadt l\u1ea1i file .htaccess m\u00e0 l\u1ed7i v\u1eabn ch\u01b0a \u0111\u01b0\u1ee3c gi\u1ea3i quy\u1ebft th\u00ec ch\u00fang ta h\u00e3y ngh\u0129 xem c\u00f3 th\u1ec3 l\u00e0 do xung \u0111\u1ed9t plugin hay kh\u00f4ng, th\u00f4ng th\u01b0\u1eddng khi c\u00e0i\u00a0 plugin m\u1edbi n\u1ebfu web b\u1ecb l\u1ed7i ngay l\u1eadp t\u1ee9c th\u00ec hay ngh\u0129 \u0111\u1ebfn ngay l\u00e0 do xung \u0111\u1ed9t plugin, n\u1ebfu v\u1eady b\u1ea1n\u00a0 h\u00e3y disable to\u00e0n b\u1ed9 plugin v\u00e0 ti\u1ebfn h\u00e0nh t\u1ea3i l\u1ea1i trang xem l\u1ed7i \u0111\u00e3 \u0111\u01b0\u1ee3c kh\u1eafc ph\u1ee5c ch\u01b0a.<\/p>\n<p><strong># T\u0103ng PHP Memory Limit<\/strong><\/p>\n<p>M\u1ed9t v\u00e0i tr\u01b0\u1eddng h\u1ee3p l\u00e0 do gi\u1edbi h\u1ea1n b\u1ed9 nh\u1edb th\u1ea5p, n\u1ebfu nh\u01b0 \u0111\u00e3 s\u1eed d\u1ee5ng nhi\u1ec1u c\u00e1ch m\u00e0 v\u1eabn ch\u01b0a kh\u1eafc ph\u1ee5c \u0111\u01b0\u01a1c th\u00ec ch\u00fang ta c\u0169ng n\u00ean \u00e1p d\u1ee5ng bi\u1ec7n ph\u00e1p n\u00e0y b\u1eb1ng c\u00e1ch s\u1eeda \u0111\u1ed5i d\u00f2ng memory_limit trong file php.ini\u00a0 nh\u01b0 sau:<\/p>\n<blockquote><p>T\u1ea1o m\u1ed9t t\u1eadp tin v\u0103n b\u1ea3n m\u1edbi c\u00f3 t\u00ean l\u00e0 php.ini<br \/>\nSao ch\u00e9p v\u00e0 d\u00e1n \u0111o\u1ea1n m\u00e3 d\u01b0\u1edbi \u0111\u00e2y v\u00e0o n\u00f3<br \/>\nmemory_limit = 256M<br \/>\nL\u01b0u t\u1eadp tin v\u00e0 t\u1ea3i n\u00f3 l\u00ean d\u01b0\u1edbi \/ wp-admin \/ th\u01b0 m\u1ee5c<\/p><\/blockquote>\n<p><strong># Do trang web s\u1eed d\u1ee5ng v\u01b0\u1ee3t qu\u00e1 t\u00e0i nguy\u00ean<\/strong><\/p>\n<p>\u0110\u00e2y l\u00e0 nguy\u00ean nh\u00e2n g\u1eb7p kh\u00e1 nhi\u1ec1u v\u1edbi m\u00e3 ngu\u1ed3n WordPress, Ch\u00ednh website c\u1ee7a t\u00f4i c\u0169ng \u0111\u00e3 t\u1eebng b\u1ecb d\u00ednh l\u1ed7i n\u00e0y, v\u00e0 sau khi s\u1eed d\u1ee5ng h\u1ebft c\u00e1c ph\u01b0\u01a1ng ph\u00e1p m\u00e0 l\u1ed7i v\u1eabn x\u1ea3y ra, \u0111i\u1ec1u \u0111\u00e1ng ch\u00fa \u00fd l\u00e0 kh\u00f4ng ph\u1ea3i l\u00fac n\u00e0o c\u0169ng b\u1ecb l\u1ed7i n\u00e0y, nhi\u1ec1u khi ch\u1ec9 chuy\u1ec3n t\u1eeb b\u00e0i vi\u1ebft n\u00e0y sang b\u00e0i vi\u1ebft kh\u00e1c ho\u1eb7c c\u00f3 nhi\u1ec1u ng\u01b0\u1eddi truy c\u1eadp c\u0169ng x\u1ea3y ra l\u1ed7i n\u00e0y. N\u1ebfu c\u00e1c b\u1ea1n \u0111ang b\u1ecb d\u00ednh l\u1ed7i 500 Internal Server Error gi\u1ed1ng nh\u01b0 m\u00ecnh v\u1eeba mi\u00eau t\u1ea3 th\u00ec c\u00e1c b\u1ea1n c\u1ea7n n\u00e2ng c\u1ea5p hosting l\u00ean m\u1ed9t b\u1eadc cao h\u01a1n, s\u1eed d\u1ee5ng RAM v\u00e0 CPU l\u1edbn h\u01a1n. Ngay khi b\u1ea1n n\u00e2ng c\u1ea5p l\u00ean th\u00ec l\u1ed7i \u0111\u00e3 \u0111\u01b0\u1ee3c kh\u1eafc ph\u1ee5c, \u0111\u1ed3ng th\u1eddi website c\u1ee7a b\u1ea1n ch\u1ea1y nhanh h\u01a1n \u0111\u00e1ng k\u1ec3.<\/p>\n<p><strong>L\u1eddi k\u1ebft:<\/strong><\/p>\n<p>WordPress l\u00e0 m\u1ed9t m\u00e3 ngu\u1ed3n m\u1edf, ch\u00ednh v\u00ec th\u1ebf m\u00e0 \u0111\u00f4i khi g\u1eb7p l\u1ed7i l\u00e0 chuy\u1ec7n r\u1ea5t b\u00ecnh th\u01b0\u1eddng,\u00a0Ch\u00fac c\u00e1c b\u1ea1n th\u00e0nh c\u00f4ng trong vi\u1ec7c qu\u1ea3n tr\u1ecb website c\u1ee7a m\u00ecnh.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>V\u1ec1 c\u01a1 b\u1ea3n website ch\u00ednh l\u00e0 m\u1ed9t ph\u1ea7n m\u1ec1m \u0111\u01b0\u1ee3c l\u01b0u tr\u1eef tr\u00ean m\u00e1y ch\u1ee7 v\u00e0 \u0111\u01b0\u1ee3c thi\u1ebft k\u1ebf b\u1edfi c\u00e1c d\u00f2ng l\u1ec7nh, Website chia l\u00e0m 2 ph\u1ea7n ch\u00ednh l\u00e0 b\u1ed9 code (l\u00e0 ph\u1ea7n khung) v\u00e0 \u0111\u01b0\u1ee3c k\u1ebft n\u1ed1i v\u1edbi database (d\u1eef li\u1ec7u trang web). Trong qu\u00e1 tr\u00ecnh v\u1eadn h\u00e0nh kh\u00f4ng th\u1ec3 tr\u00e1nh kh\u1ecfi nh\u1eefng [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":16424,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"tags":[],"ht_kb_category":[5167,5154],"class_list":["post-4278","ht_kb","type-ht_kb","status-publish","format-standard","has-post-thumbnail","hentry","ht_kb_category-cau-hoi-chung-ve-wordpress","ht_kb_category-wordpress"],"_links":{"self":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb\/4278","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb"}],"about":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/comments?post=4278"}],"version-history":[{"count":0,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb\/4278\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media\/16424"}],"wp:attachment":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media?parent=4278"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/tags?post=4278"},{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/ht_kb_category?post=4278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}