Ошибка сервера 500 вордпресс

Способы исправления внутренней ошибки сервера 500 на WordPress- сайте. Основные причины появления сообщения об ошибке 500, методы обнаружения и устранения неполадок

Сообщение об ошибке сервера 500 на стороне клиента или в панели администрирования может стать источником серьезных проблем и причиной потери посетителей. Устранить внутреннюю ошибку сервера HTTP 500 особенно сложно, потому что причины возникновения подобной неполадки могут быть самыми разными.

Формат сообщения о внутренней ошибке сервера 500 не предполагает никаких пояснений о возможном источнике проблемы, и на поиск причины возникновения неполадки могут уйти часы терпеливой работы. В это время сайт теряет посетителей и возможные продажи, страдает репутация компании.

Если на вашем сайте появилось сообщение о внутренней ошибке сервера HTTP 500, понадобятся все возможные способы устранения возникшей проблемы, которые рассмотрены в этой статье. Надеюсь, это руководство поможет вернуть сайт в рабочее состояние в кратчайшие сроки.

  • Краткая справка: внутренняя ошибка сервера 500 в WordPress
  • Создайте резервную копию сайта
  • Перезагрузите страницу
  • Проверьте журнал сервера
  • Очистите кэш браузера
  • Проверьте доступность панели администратора
  • Отключите тему оформления или плагин, вызывающие ошибку
  • Проверьте файл .htaccess
  • Увеличьте лимит памяти для PHP
  • Проверьте права доступа
  • Переустановите WordPress
  • Обратитесь в техподдержку
  • Обратитесь к специалисту по отладке
  • Заключение

Краткая справка: внутренняя ошибка сервера 500 в WordPress

Подобное сообщение уведомляет пользователей о том, что неполадка в работе WordPress-сайта возникла на стороне сервера. В браузерах посетителей сайт не отображается. Эта ошибка особенно опасна тем, что может помешать входу в панель администрирования.

Вопреки распространенному мнению, подобная ошибка не связана с неполадками в работе сервера. Она указывает на проблему с корневым каталогом WordPress-сайта. Это означает, что для обнаружения истинной причины возникшей проблемы понадобится немало проб и ошибок. В зависимости от используемого браузера, сообщение об ошибке выглядит по-разному:

  • 500 internal server error (500 внутренняя ошибка сервера);
  • Internal server error (внутренняя ошибка сервера);
  • Error 500 (ошибка 500);
  • HTTP error 500 (HTTP ошибка 500);
  • HTTP error 500-internal server error (HTTP ошибка 500 – внутренняя ошибка сервера);
  • Temporary error (500) (временная ошибка 500);
  • Error code: 500 (код ошибки: 500).

Независимо от формата сообщения, ошибка 500 возникшая на WordPress, негативно повлияет на индексирование в поисковиках, репутацию, трафик, и, конечно же – продажи. Ниже приведена инструкция с перечнем наиболее эффективных методов решения проблемы.

Создайте резервную копию сайта

До начала каких-либо действий по поиску причин возникновения ошибки 500 следует провести резервное копирование сайта, если бекапа у вас нет или он уже устарел. Процесс решения подобной проблемы может вызвать серьезные изменения в корневом каталоге, где хранятся все файлы WordPress. При наличии резервной копии сайта можно не опасаться любых изменений. Используйте плагин для автоматического создания резервной копии, затем сохраните бекап на внешнем носителе или в облачном хранилище.

Это самое первое, что стоит сделать – возможно, серверу просто понадобилось очистить кэш или удалить временные файлы. Внутренние ошибки сервера часто возникают после обновления сайта, активации новой темы, добавления плагинов. Сервер может быть перегружен, и сообщение об ошибке просто исчезнет после перезагрузки сайта. Если такое случается часто – это повод подыскать более надежный хостинг для WordPress.

Также стоит проверить работоспособность сайта с помощью сервиса downforeveryoneorjustforme.com – он покажет, если интернет-ресурс полностью недоступен всем посетителям, либо проблема находится на вашей стороне.

Содержимое лога сервера может пролить свет на причины возникновения проблемы. Журналы сервера предоставляют ценную информацию, и помогут выяснить многие причины возникновения неполадки. Среди возможных причин может оказаться установка некорректной темы оформления, плагина; ошибки при установлении соединения с базой данных.

При ошибках, связанных с базами данных, браузер обычно показывает пустую страницу, которую иногда называют «белым экраном смерти». Вследствие отсутствия соединения с базой на экране не будет никаких данных. Эта неполадка не только уничтожает клиентскую часть сайта, но и лишает администратора доступа в панель управления.

Основные причины подобной проблемы следующие:

  1. Поврежденный файл базы данных WordPress.
  2. Повреждение файлов движка WordPress злоумышленниками или вирусами.
  3. Перегрузка базы данных запросами при большом объеме трафика – такое чаще всего происходит на общих хостингах.

Для решения возникшей проблемы, прежде всего, проверьте корректность параметров конфигурации базы данных, или восстановите базу данных из резервной копии. WordPress также предоставляет встроенный метод исправления нерабочей базы данных следующей командой:

Define(‘WP_ALLOW_REPAIR’, true);

Очистите кэш браузера

Очистка кэша улучшает производительность браузера и решает многие проблемы с неправильной загрузкой сайтов. Существует множество эффективных и бесплатных утилит для полной очистки кэша.

Попробуйте зайти в панель управления по стандартной ссылке. Если попытка не удалась, сообщение о внутренней ошибке сервера 500 может указывать на проблему с недавно установленными темами оформления и плагинами.

Отключите тему оформления или плагин, вызывающие ошибку

Если вам не удается войти в панель администрирования WordPress для отключения некорректной темы оформления или плагина, придется действовать обходным путем. Способ прост, хотя и займет некоторое время. Понадобится FTP-клиент для прямого доступа к файлам сайт. Скачайте, например, FileZilla, введите в параметрах соединения адрес сайта, логин и пароль, подключитесь к серверу – файлы вашего сайта будут в окне справа.

Найдите папку под названием plugins и переименуйте ее в plugins_deactivate. Все плагины будут отключены. Перезагрузите сайт – если ошибка исчезла, значит, причина была в плагине. Теперь вы можете войти в панель администрирования. Войдите и начните активировать плагины по одному. Перезагружайте сайт после активации каждого плагина – так вы обнаружите проблемный. Удалите его, найдите ему замену или уведомите разработчика о проблеме, с которой вы столкнулись. Не забудьте вернуться в FTP-клиент и переименовать директорию обратно, чтобы исправные плагины стали активными.

Если окажется, что ошибку вызывают не плагины, проделайте эти же самые шаги, последовательно проверяя все темы оформления в папке themes. Удалите проблемную тему оформления и перезагрузите сайт.

Проверьте файл .htaccess

Установка новой темы оформления или плагина могут вызвать изменения в файле .htaccess, что также может стать причиной сообщения о внутренней ошибке сервера. Эту проблему легко решить с помощью FTP-клиента.

Найдите файл .htaccess, кликните по нему правой кнопкой мыши и переименуйте в .htaccess_old. Перезагрузите файл – если сообщение об ошибке исчезло, значит, проблема действительно была связана с файлом .htaccess. Войдите в панель администрирования, выберите раздел «Постоянные ссылки» в меню «Настройки», затем нажмите кнопку «Сохранить изменения». Эта процедура восстановит оригинальный файл .htaccess и избавит вас от ошибки 500.

Если ваш WordPress-сайт использует множество скриптов, перегружающих доступный объем памяти, это также может стать причиной возникновения ошибки 500. Объем памяти регулируется настройками хостинга и движком WordPress. Увеличить объем памяти для PHP можно несколькими способами.

  • Изменить параметры в файле wp-config.php. Зайдите в папку сайта с помощью FTP-клиента, найдите файл wp-config.php, кликните по нему правой кнопкой мыши и выберите в контекстном меню пункт «Просмотр/Редактирование». В качестве редактора по умолчанию можно использовать «Блокнот». Перед строкой «Happy Blogging» добавьте следующий фрагмент кода:
define(‘WP_MEMORY_LIMIT’,’64’);

Сохраните отредактированный в «Блокноте» файл на своем жестком диске, найдите его в левом окне FTP-клиента, кликните по нему правой кнопкой мыши и выберите в контекстном меню пункт «Загрузить». Если после перезагрузки сайта ошибка 500 исчезла – проблема была в доступном объеме памяти.

  • Отредактировать файл php.ini. Чтобы найти этот файл, активируйте опцию «Показывать скрытые файлы»; файл php.ini расположен в подкаталоге wp-admin корневой директории. Откройте файл php.ini, найдите строку, начинающуюся с «memory_limit». Если указанное значение составляет 64 Мб и менее, замените его новым параметром:

Если вам не удалось найти файл php.ini, создайте его самостоятельно с помощью программы «Блокнот». Вставьте в созданный файл приведенный выше код и загрузите его на хостинг, в папку wp-admin.

  • Изменить файл .htaccess. С помощью FTP-клиента найдите файл на хостинге и добавьте в него следующую строку:
php_value memory_limit 256M

Это увеличит лимит памяти до 256 Мб. Если вы не смогли найти файл .htaccess – активируйте опцию «Показывать скрытые файлы» или создайте подобный файл самостоятельно, после чего загрузите его в папку wp-admin.

Чтобы избежать повторного появления ошибки 500, придется выяснить, какой именно компонент сайта перегружает память. Это может быть некорректно написанный плагин или тема оформления. Можно обратиться за помощью в техподдержку хостинга – специалисты смогут выявить проблемный компонент с помощью журнала сервера.

В соответствии с правилами безопасности WordPress, протокол назначения прав доступа выглядит следующим образом:

  1. Все директории должны иметь права 755 или 750.
  2. Для файлов назначают права 644 или 640, кроме файла wp-config.php, который должен иметь права 400 или 440 с целью обеспечения защиты от несанкционированного доступа.
  3. Ни в коем случае не назначайте права 777 для директорий.

Если права доступа имеют какие-либо другие параметры, возможно появление ошибки 500. Параметры можно проверить с помощью FTP-клиента – они указаны в «Разрешениях». Если вы обнаружите файл или папку с правами доступа, отличающимися от регламентированных – кликните правой кнопкой и измените соответствующий параметр на правильный.

Переустановите WordPress

Системные файлы могут повреждаться со временем, в таком случае понадобится переустановка WordPress. Такие повреждения случаются редко, но если все рассмотренные выше методы не помогли, это единственный оставшийся вариант. Переустановка ничем не отличается от первоначальной установки WordPress – скачайте свежий установочный файл с www.wordpress.org и установите WordPress на свой хостинг.

Установочные файлы находятся в папке WordPress. Подключитесь к серверу с помощью FTP-клиента, найдите папки wp-admin и wp-includes, начните загрузку файлов. Когда появится запрос о действиях с существующими файлами, выберите «Переписать». Эта операция заменит все старые файлы в директориях wp-admin и wp-includes новыми. Если после перезагрузки сайта все заработает правильно – проблема была в поврежденных файлах WordPress.

Если все приведенные выше способы не решили проблему, обратитесь в техподдержку хостинга. При выборе надежного хостинга для WordPress всегда важно учитывать наличие в штате специалистов, имеющих опыт в решении проблем с внутренней ошибкой сервера 500. Специалисты исправят подобную ошибку самостоятельно или проведут владельца сайта шаг за шагом через все этапы, необходимые для решения проблемы.

WordPress включает в себя инструмент для тестирования и отладки. Он пригодится, если источник возникшей проблемы остается неясным. В ходе отладки в файл wp-config.php вставляют фрагменты кода, который поможет определить причины неполадок. Результаты тестов записываются в файл, расположенный в корневом каталоге. Для интерпретации и последующей настройки лучше обратиться к опытному профессионалу: новичку сложно отличить незначительную ошибку от серьезной. Кроме того, в процессе тестирования фрагменты кода могут быть видны посетителям сайта.

Внутренняя ошибка сервера 500 досадна – особенно потому, что причины ее появления часто неясны, а единственного простого решения не существует. Приведенные в этой статье методы не требуют навыков программирования, но в большинстве случаев помогут решить возникшую проблему.

Если сайт расположен на бюджетном общем хостинге, лучше сменить тарифный план или выбрать хостинг-провайдера, который возьмет на себя обязательства по обеспечению стабильной работы вашего интернет-ресурса.

Сен 28, 2022

Elena B.

7хв. читання

Как Исправить Ошибку 500 Internal Server Error в WordPress

Столкнулись с ошибкой 500 Internal Server Error в WordPress? Ну что же, вы не одни! Ошибка 500 Internal Server Error — одна из самых распространённых ошибок с которой сталкиваются пользователи WordPress. Среди возможных причин появления ошибки: повреждённые файлы .htaccess, неправильно установленные права, задержки скрипта, неправильная версия PHP или неудачное обновление WordPress.

Однако выявить истинную причину не так просто, как, например, в случае ошибки 404, которую могут вызвать либо неработающие постоянные ссылки, либо изменённые URL-адреса страниц.

Вот краткое руководство по исправлению ошибки 500 в WordPress с помощью 9 различных способов. Давайте не будем терять время и начнём данное руководство по WordPress.

Обратите внимание, что Hostinger предлагает специальный оптимизированный для WordPress хостинг. Воспользуйтесь предложением и получите WordPress хостинг со скидкой до 82%!

К предложению

Что вам понадобится

Перед тем, как вы начнёте это руководство, вам понадобится следующее:

  • Доступ к панели управления вашим хостингом
  • Доступ к панели управления WordPress

ВАЖНО! Безопасность прежде всего. Перед началом данного руководства, мы рекомендуем произвести резервное копирование вашего сайта для предотвращения потери данных.

Способ 1 — Ошибка 500 в WordPress из-за плагинов или тем

В большинстве случаев, ошибка 500 Internal Server Error возникает из-за установки или обновления плагинов или тем. Если вы уже знаете какой из плагинов мог вызвать данную проблему, вы уже на пол пути к её решению.

Способ 1.1 — Ошибка 500 в WordPress из-за обновления или установки плагина

Если страница перестала работать после установки или обновления плагина, вы можете починить её, просто отключив или удалив плагин. В зависимости от ситуации, существует два пути для достижения цели.

Отключение плагинов через панель управления WordPress

Если вы можете войти в  вашу панель управления WordPress, следуйте данным этапам:

  1. Войдите в вашу панель управления WordPress.
  2. Нажмите на Плагины → Установленные в левом меню навигации.

hostinger плагины установленные

  1. Отключите проблемный плагин.

hostinger plagini deactivirovat

  1. Обновите сайт в браузере, чтобы проверить решена ли проблема.
  2. Если нет, отключите другой плагин и повторяйте данный процесс, пока все плагины не будут отключены (или сайт не заработает).
  3. Как только вы найдёте плагин, ответственный за появление ошибки, попробуйте переустановить его заново. Вы также можете поискать другие плагины на его замену или связаться с разработчиками плагина для уточнения информации о его работе на вашем WordPress.

Отключение плагинов WordPress через Файловый Менеджер или FTP

Существуют ситуации, когда ошибка не позволяет получить доступ к панели управления WordPress. В этом случае, вам придётся отключить или удалить плагин с помощью Файлового Менеджера в панели управления вашим хостингом или FTP-клиентом вроде FileZilla.

  1. Пройдите в корневой каталог вашего WordPress и войдите в папку wp-content/plugins.
  2. Найдите проблемный плагин и переименуйте его для отключения. К примеру, вы можете добавить .отключён в конец файла, чтобы не забыть об этом плагине. Если вы хотите удалить его полностью, просто удалите папку с плагином.

hostinger ошибка 500 плагины

  1. После этого, обновите ваш сайт. В случае, если проблема остаётся, произведите данные действия для оставшихся плагинов до их полного отключения (или пока ваш сайт не заработает).
  2. Как только вы найдёте сломанный плагин, вы можете попытаться переустановить его, найти замену или связаться с разработчиками плагина для получения консультации.

Способ 1.2 — Ошибка 500 в WordPress из-за установки или обновления темы

Если ваш сайт перестал работать после установки или обновления темы, вы можете решить проблему изменив тему вашего сайта. Для этого существует два пути:

Изменение темы с помощью панели управления WordPress

Если вы можете получить доступ к вашей панели управления, вот что вы должны предпринять:

  1. Перейдите в раздел Внешний вид → Темы.

hostinger внешний вид темы

  1. Выберите любую другую тему и нажмите кнопку Активировать.

hostinger внешний вид темы 2

  1. Как только вы закончите изменение темы, вы увидите подтверждающее сообщение со ссылкой на ваш сайт.

hostinger внешний вид тема активирована

Изменение темы с помощью phpMyAdmin

Другой способ для изменения темы, это редактирование значений вашей базы данных MySQL через phpMyadmin, в панели управления вашим хостингом. Этот способ может быть полезен, если ваша панель управления WordPress не работает. Вот, что вы должны сделать:

  1. Найдите таблицу wp_options и откройте её.

hostinger php my admin

ЗАМЕТКА! В зависимости от значений таблицы, выбранных вами в процессе установки, префикс таблиц не всегда будет wp_.

  1. Перейдите на Страницу 2.

hostinger phpmyadmin 2

  1. Найдите раздел template и stylesheet

hostinger phpmyadmin 3

  1. Узнайте название темы на которую вы хотите её поменять. Для этого перейдите в каталог  wp-content/themes с помощью Файлового Менеджера.

hostinger phpmyadmin 4

  1. Скопируйте название темы, которую вы хотели бы использовать. Далее, измените значения template и stylesheet в базе данных на название вашей новой темы. В данном примере, мы изменим тему twentyfifteen на twentysixteen

hostinger phpmyadmin 5

Теперь вы снова можете перезагрузить ваш сайт в браузере, и он загрузится с новой темой. Если ошибка 500 была связана с вашей старой темой, то это должно решить проблему. Вы можете попытаться переустановить вашу старую тему или связаться с разработчиком для получения информации о правильной установке темы для вашего WordPress.

Способ 2 — Проверка файла .htaccess

Ещё одним способом для избавления от ошибки internal server error, является проверка состояния вашего файла .htaccess. Вероятность того, что ваш нынешний файл .htaccess был повреждён, весьма высока. Это могло случиться из-за огромного количества причин; самые распространённые из них это установка нового плагина или другие изменения на вашем сайте.

Лучшим методом для проверки состояния вашего файла .htaccess является создание нового. Всё, что вам нужно сделать это:

  1. Войти в панель управления вашим хостингом, далее в Файловый Менеджер в разделе Файлы. Альтернативный способ, это использовать FTP-клиент вроде FileZilla.
  2. Перейдите в корневой каталог вашего WordPress сайта (если вы видите файлы вроде wp-content и wp-includes, вы в правильном месте).
  3. Найдите здесь файл .htaccess и отключите его. Это можно сделать задав ему другое имя. К примеру, .htaccess1.

hostinge ошибка 500 htaccess

  1. После этого, создайте новый файл .htaccess и вставьте в него стандартный код .htaccess:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
  1.  Убедитесь, что сохранили файл.

Теперь, откройте ваш сайт в браузере и посмотрите исправлена ли ошибка. Если нет, продолжите чтение руководства.

Способ 3 — Увеличение лимитов PHP

Если два способа описанных выше не принесли никакого результата, то неправильные значения PHP или нехватка памяти могли стать причиной появления ошибки 500. Это происходит из-за того, что скрипты и плагины требуют определённое количество памяти для своей правильной работы. В дополнение к этому, когда загружается ваш сайт, браузер делает огромное количество запросов для загрузки скриптов, плагинов и контента. Когда количество памяти для загрузки скриптов и плагинов не хватает, WordPress, скорее всего, выдаст ошибку 500 Internal Server Error. Именно поэтому, важно увеличить значение памяти вашего сайта и других PHP настроек. Вы можете это сделать с помощью файла .htaccess. Вот несколько строк, которые мы рекомендуем вам добавить:

php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value max_execution_time 300
php_value max_input_time 300
php_value memory_limit 256M

hostinger ошибка 500 htaccess 2

Не забудьте Сохранить изменения. Теперь, обновите ваш сайт. Если проблема возникала из-за недостаточных лимитов PHP, то этот способ должен помочь с её решением.

Способ 4 — Изменение версии PHP

Некоторые скрипты или плагины для WordPress требуют определённую версию PHP. Если рекомендуемые требования для них не выполнены, то в следствии этого может появиться ошибка 500. Вы можете проверить вызвана ли она версией PHP, изменив её. Это можно сделать через панель управления хостингом в разделе Дополнительно → Выбор PHP версии.

hostinger ошибка 500 php версия

В случае, если вы не знаете какая версия PHP вам необходима, попробуйте поочередно включать каждую из них. Не забудьте Сохранять ваши настройки и обновлять сайт при каждом изменении. Если ни одна из данных версий не помогла в решении ошибки 500, то верните вашу прошлую версию PHP и перейдите к следующем способу.

Способ 5 — Включение отображений ошибок

Поиск причины возникновения ошибки WordPress 500 Internal Server Error — это самая сложная часть в процессе её исправления. Если ни один из предыдущих способов вам не помог, значит вам необходимо начать поиски поглубже — проверив ваши ошибки. Существует несколько способов для этого:

Включение отображение ошибок

Включив отображение ошибок, вы сможете найти определённый код вашего сайта, который её вызывает. Это можно сделать в том же разделе, где мы меняли версию PHP. Дополнительно → Выбор PHP версии. Установите значение Отображать Ошибки на Включена и нажмите кнопку Сохранить.

hostinger ошибка 500 отображать ошибки

Теперь, вы должны перезагрузить ваш сайт. Все ошибки кода будет отображены на экране, как на картинке ниже:

wp ошибка на экране

Как только вы найдёте ошибку, откройте указанный в ней файл и посмотрите нужную строку. Вы можете использовать Google, Stackoverflow, WordPress Форум, или связаться с вашим разработчиком для получения информации о решении данной проблемы.

Способ 6 — Использование отладки WordPress

WordPress имеет свою собственную систему отладки, которую вы можете использовать для решения проблем с вашим кодом. Это также может помочь решить проблему ошибки 500. Для начала её использования, вам необходимо сделать несколько изменений в вашем файле wp-config.php.

  1. Найдите следующую строчку в файле wp-config.php:
define('WP_DEBUG', false);
  1. Удалите и вставьте на её место следующий код:
 // Enable WP_DEBUG mode
define( 'WP_DEBUG', true );
 
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );
 
// Disable display of errors and warnings 
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
 
// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define( 'SCRIPT_DEBUG', true );
  1. Обновите ваш сайт и откройте Файловый Менеджер. Перейдите в каталог wp-content и найдите файл debug.log. Откройте редактирование данного файла для просмотра его значений.

wordpress отладка

  1. Теперь вы знаете, что является причиной возникновения ошибки и сможете решить её, обратившись к разработчику или Google, Stackoverflow, WordPress Форуму. Более детальная информации о системе отладки может быть найдена здесь.

Способ 7 — Восстановление резервной копии

Если вы сделали бэкап WordPress до его поломки, восстановление резервное копии тоже может стать решением. Для начала, удалите все файлы WordPress. Затем, загрузите ваш бэкап, перепроверьте, работает ли ваш сайт.

Ручной способ восстановления WordPress может подойти не всем. Если вам кажется это слишком сложным, то мы можем подсказать вам другой способ. К сожалению, это не поможет вам, если ваш сайт не работает, но он точно поможет вам избежать подобных проблем в будущем.

  1. Установите и активируйте плагин All-in-One WP Migration.

hostinger ошибка 500 wp backup

  1. Найдите его в панели управления вашим WordPress и нажмите кнопку Export.

hostinger ошибка 500 wp backup 2

  1. Выберите опцию File (Файл), если вы хотите скачать резервную копию на ваш компьютер.

hostinger ошибка 500 wp резервное копирование

  1. Скачайте сгенерированную резервную копию на ваш компьютер. Она содержит файлы вашего сайта и базы данных.
  2. Теперь в случае появления ошибки 500 Internal Server Error (или любой другой проблемы) и невозможности её решения, вы можете просто восстановить ваш сайт с помощью резервной копии.
  3. Для восстановления сайта с помощью сгенерированной резервной копии, вам необходимо полностью удалить ваш сайт и установить новый WordPress, вместе с плагином All-in-One. После этого, выберите функцию Import (Импорт), выберите сгенерированный бэкап и продолжите процедуру восстановления.

hostinger ошибка 500 импорт

Способ 8 — Переустановка файлов WordPress

Если ошибка ещё появляется, есть кардинальное средство для её решения. Всё, что вам нужно сделать это:

  1. Скачать последнюю версию WordPress.
  2. Сохранить и распаковать её на вашем компьютере.
  3. Удалить файл wp-config-sample.php и папку wp-content для избежания перезаписи важной информации.
  4. Переместить все корневые файлы на ваш хостинг аккаунт и перезаписать их. Это можно сделать с помощью FTP-клиента FileZilla.

hostinge ошибка 500 ftp сайт

  1. Далее, должно появиться окно с разрешением на перезапись файлов. Поставьте значения как на изображении для автоматизации процесса.

hostinger ошибка 500 ftp сайт 2

ЗАМЕТКА! Убедитесь, что вы сделали резервное копирование вашего сайта перед началом данного процесса. Это позволит избежать потери важной информации.

Процесс загрузки может занять от 10 до 20 минут. После завершения, попробуйте вновь обновить ваш сайт в браузере. Если ошибка 500 Internal Server Error была связана с корневыми файлами WordPress, этот способ должен помочь решить проблему.

Способ 9 — Начать всё заново

Если все из приведённых способов вам не помогли, вам придется начать создание вашего сайта с нуля. Хорошей новостью является то, что вы можете восстановить ваш сайт даже с помощью резервной копии базы данных. Загляните в данное руководство для пошаговой инструкции по восстановлению вашего сайта только с помощью базы данных MySQL.

Заключение

Все, кто используют WordPress хотя бы раз сталкивались с ошибкой internal server error. Являетесь ли вы продвинутым разработчиком или начинающим пользователем, исправление ошибки 500 является довольно простым процессом, если вы знаете, где искать её причину. Как и в реальной жизни, для решения проблемы нужно сначала найти её источник. После этого, вы можете использовать онлайн ресурсы или это руководство для решения данной проблемы.

У вас есть чем с нами поделиться? Расскажите о ваших идеях или советах в комментариях!

Author

Елена имеет профессиональное техническое образование в области информационных технологий и опыт программирования на разных языках под разные платформы и системы. Более 10 лет посвятила сфере веб, работая с разными CMS, такими как: Drupal, Joomla, Magento и конечно же наиболее популярной в наши дни системой управления контентом – WordPress. Её статьи всегда технически выверены и точны, будь то обзор для WordPress или инструкции по настройке вашего VPS сервера.

Seeing a 500 internal server error where your website should be is enough to throw anyone into a panic. When your website goes down, you lose out on potential traffic and sales. If it’s offline for a while, it can also negatively impact your Search Engine Optimization (SEO) efforts.

Fortunately, there are plenty of ways to go about fixing this error. Many of these solutions are fairly straightforward, and you don’t need a lot of technical know-how to start troubleshooting.

In this guide, we’ll cover what the 500 internal server error in WordPress is and discuss some potential causes. Then we’ll give you 10 tips to help you get your website back in working order.

  1. Back up your website.
  2. Try reloading the page.
  3. Clear your browser cache.
  4. Access your error logs.
  5. Check for the “Error Establishing a Database Connection.”
  6. Look for permission errors.
  7. Increase your PHP memory limit.
  8. Check for problems with your .htaccess file.
  9. Look for coding or syntax errors in your CGI/Perl script.
  10. Ask your web host about potential server issues.

Let’s get started!

Dealing with the WordPress Internal Server Error?

Avoid troubleshooting when you sign up for DreamPress. Our friendly WordPress experts are available 24/7 to help solve website problems — big or small.

What Is the 500 Internal Server Error?

The 500 internal server error is frustratingly nonspecific. When the error occurs, you usually don’t get many details about it. In fact, you might not receive any information at all.

An example of a 500 internal server error screen.

The 500 error is a generic issue that isn’t specific to WordPress. Chances are you’ve seen it before during your internet explorations. Despite the name, it doesn’t necessarily mean that something is wrong with your server. It could be an issue with your website or browser.

If you do see this error on your site, you’ll want to get it fixed as quickly as possible. A 500 error can impact your SEO if allowed to linger. If your site is crawled while it’s offline, there’s a chance that Google may interpret the error as an issue with your website.

This error can also hurt your User Experience (UX) and give visitors the impression that you’re unprofessional. Not only can a poor UX affect the way Google ranks your site, but it can cause you to lose customers as well. After all, you can’t do business if your site isn’t accessible.

A wide variety of situations can result in the 500 error, making it a bit of a chore to sort out. Potential causes of the 500 internal server error in WordPress include:

  • Plugin compatibility issues
  • Exhausted PHP memory limit
  • Corrupted files
  • Coding or syntax errors

The fact that the error message itself tends to be vague doesn’t help. Fortunately, you can solve many of these issues on your own with a bit of know-how.

Variations on the 500 Internal Server Error

Depending on your operating system, browser, and the cause of the error, there are variations in how it will appear. For example, if a database connection can’t be established, you might see something like this:

An error establishing a database connection message.

A plain white screen, sometimes referred to as the White Screen of Death (WSoD), can indicate a 500 internal server error.

A blank browser window due to a 500 error.

Also, many site owners have the option to customize their 500 error messages. So you might see this error in many different forms.

How to Fix the 500 Internal Server Error in WordPress (10 Tips)

Now that you’ve had an introduction to the 500 internal server error, it’s time to discuss how to resolve it. Let’s take a look at ten tips you can use to fix this issue in WordPress.

1. Back up your website.

Before tinkering under the hood, it’s always smart to make a backup of your website. If DreamHost hosts your site, you can take advantage of our one-click backup feature. You can also create a manual backup if you prefer.

To make a complete backup, you’ll need to save copies of your WordPress files as well as your databases. You can back up your site’s files using a Secure File Transfer Protocol (SFTP) client such as FileZilla.

Once you’re connected to your server, navigate to the WordPress files you want to save. These files include the WordPress core installation, plugins, themes, images, and more. To save the files, simply right-click on them and select Download.

How to download WordPress files via SFTP.

Now you’ll need to back up your database, which you can do by logging into phpMyAdmin. Select the database you want to download from the left-hand panel, and then click on the Export tab.

You’ll then need to choose between a “Quick” or a “Custom” export. The Quick export will likely work just fine unless you need to manage more advanced options.

Options for downloading a WordPress database using phpMyAdmin.

Click on the Go button, and your download should start. Once your website is safely backed up, you can get to work on fixing that 500 error.

2. Try reloading the page.

Let’s start with the best-case scenario. Some situations that cause a 500 internal error clear up on their own within a few minutes. For example, if you’ve just made changes to a plugin or theme, or if your host is experiencing unusually heavy traffic, you may see a server error. If this is true in your case, you’re in luck, as a simple page reload should get things back to normal.

Therefore, the first thing to try is simply waiting a minute or two, during which the error will hopefully resolve itself. Then you can try reloading the page by pressing F5 or (command + R if you’re using a Mac).

3. Clear your browser cache.

Another potential server error fix that’s quick and easy is clearing your browser cache. It’s possible the cache became corrupted, which would cause problems when attempting to access websites.

First, you might check Down For Everyone Or Just Me. This will determine whether there’s a widespread problem or you’re the only one experiencing difficulties.

Amazon.com’s status on Down for Everyone or Just Me.

If you’re alone in your 500 error frustration, the problem may be your browser. Try accessing your site from a different browser. If an alternative works, it’s a sign that the issue is with your cache.

In Google Chrome, you can clear your cache by pressing Ctrl + Shift + Delete. Alternatively, you can click on the three vertical dots in the top-right corner, followed by More tools > Clear browsing data.

Options for clearing the browser cache in Chrome.

Be sure to check the Cached images and files box. Then click on the Clear data button.

In Firefox, you can clear the cache using the Ctrl + Shift + Delete keyboard shortcut. This will open the Clear Recent History window. In the Time range to clear drop-down menu, select Everything. Check the Cache box, and then click on OK.

Options for clearing browser data in Firefox.

In Safari, you can navigate to the History menu item and choose Clear History. Keep in mind that this will delete everything, including cookies and visited pages.

How to clear the browser cache in Safari.

Once you’ve cleared your browser cache, you can attempt to access your website again. If you’re still seeing the 500 internal server error, it’s time to move on to more involved fixes.

4. Access your error logs.

Your site’s error logs may provide insight into what’s causing the 500 error. Depending on your host, these logs may be cycled quite often, so you’ll want to take a look as soon as possible.

You can check your error logs by accessing your site’s files via SFTP and looking for the /logs directory. Next, select the site that’s experiencing the error. You may see several directories at this point. You’ll want to check the one with the most recent date.

Error and access log files accessed via FileZilla.

You can view the log by downloading it and opening it with your preferred text editor. Hopefully, your error logs will provide you with some additional context for the 500 error.

Another option is to enable the WordPress debug log. You can do this by connecting to your site via SFTP and opening your wp-config.php file. Within it, look for the following line:

define('WP_DEBUG', false);

Once you find it, replace it with the following:

define( 'WP_DEBUG', true );

define( 'WP_DEBUG_DISPLAY', false );

define( 'WP_DEBUG_LOG', true );

This will create a debug.log file, which you can find under the /wp-content/ directory. Just be sure to change the WP_DEBUG value back to “false” when you’re done troubleshooting.

5. Check for the ‘Error Establishing a Database Connection.’

If there’s been a problem establishing a database connection, not only will your site be offline for visitors, but you won’t be able to access the WordPress admin dashboard either. There are a few possible causes of this:

  • Incorrect database login credentials
  • A corrupted WordPress database
  • A corrupted WordPress installation file

Let’s start with incorrect login credentials, as this is a common cause of the database connection error. If you’re a DreamHost user, you can find your database credentials in your panel. However, if you use a different host, you’ll likely follow a similar procedure.

Navigate to MySQL Databases and find the one that corresponds to your website under the Database(s) on this server section. Here, you’ll find your database name under the Database heading. The username is listed under the Users Access column.

Alt-text: Where to find your MySQL username in DreamPanel.

To find the password, click on the username. On the next screen, scroll down and click on the Show button next to the password field.

How to find your database password in DreamPanel.

Next, you’ll compare these credentials to those in your wp-config.php file. You can access this file in your site’s main directory via SFTP. Once you have the file downloaded, open it and verify that the information under MySQL Settings matches what you found in your panel.

Checking MySQL settings in the wpconfig.php file.

Next, if your database is corrupted, you can quickly repair it through phpMyAdmin. Log in and click on your database in the left panel. Select all of the tables in the database, and then choose the Repair table option from the drop-down menu.

Repairing a database in phpMyAdmin.

Finally, let’s look at how to handle a corrupted WordPress installation file. Start by downloading a new copy of WordPress and unzipping the file. You’ll need to delete the wp-content folder and the wp-config-sample.php file.

Deleting files from a new WordPress installation.

Upload the rest of the files to your site via SFTP, overwriting any existing ones. You now have a brand new, uncorrupted WordPress installation. You’ll also want to clear your browser cache before checking your website again.

6. Look for permission errors.

If any of your files have permissions set incorrectly, you may see the 500 internal server error as a result. Again, you can check and change these permissions using SFTP.

Right-click on any file and select File permissions to open a new dialogue window. In this window, you can check and, if necessary, set new permissions for the file.

Checking and updating file permissions using FileZilla.

Typically, you’ll want to set files to “644” and directories and executables to “755”. However, you may want to check with your host if you’re unsure about the correct values.

7. Increase your PHP memory limit.

Another reason you might see the 500 internal server error is if you’ve exceeded your server’s PHP memory limit. There are several ways to increase your limit, and they all involve using SFTP.

Before you try increasing your memory limit, you may want to start by seeing what it’s currently set to. You can do this through the WordPress admin dashboard. Keep in mind that, with some variations of the 500 error, you won’t be able to access the dashboard. If that’s the case, you may have to skip this step.

From your WordPress dashboard, navigate to Tools > Site Health. Click on Info at the top of the screen, and scroll down to the Server section. You should see your PHP memory limit there.

How to check your WordPress site’s PHP memory limit.

To increase the PHP memory limit, there are a few files you can edit. One is your .htaccess file, typically located in your site’s root directory. Open the file and add the following code:

php_value memory_limit xxxM

You can replace the “xxx” with your desired amount of memory. Usually, 256M is plenty.

You can also increase your memory limit by editing your php.ini file. You should be able to find this file in your root directory. If not, you can go ahead and create one. Add or update its code to the following:

memory_limit = xxxM

Another option is to add in the following code at the top of your wp-config.php file:

define('WP_MEMORY_LIMIT', 'xxxM');

If this resolves the 500 error, your next task will be to figure out what is causing the memory limit exhaustion. It could be a problematic plugin or theme. You might consider reaching out to your host for help on finding the exact server diagnostics.

8. Check for problems with your .htaccess file.

Your .htaccess file is one of the core WordPress files. It contains rules for your server, so it could contribute to a 500 internal server error.

If your .htaccess file has become corrupted, you’ll want to go ahead and create a fresh one. Start by logging into your site via SFTP and finding your .htaccess file. Rename the file to .htaccess_old.

Renaming a file in FileZilla.

Now, create a new .htaccess file in your text editor and paste in the following:

# BEGIN WordPress

RewriteEngine On

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteBase /

RewriteRule ^index.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

# END WordPress

Go ahead and upload your newly created .htaccess file. Then refresh your site in your browser, and check to see whether the error message is showing.

9. Look for coding or syntax errors in your CGI/Perl script.

If you’re running Common Gateway Interface (CGI) scripts, any coding errors you’ve made could result in a 500 error. To unearth potential issues with your CGI scripts, log into your site using Secure Shell Access (SSH).

Once you’ve logged in, you can troubleshoot your CGI with this command:

[server]$ ./cgi_name.cgi

The terminal should return a general error message and the line number the culprit is located on. From there, you can work your coding magic!

When working with CGI, there are a few best practices to keep in mind to avoid problems. First, it’s wise to use a plain text editor to ensure that you maintain ASCII format. When you upload scripts, you should also be able to select ASCII mode in your FTP client.

Changing the transfer type option in FileZilla.

Finally, if necessary, upload to the cgi-bin directory on your server. Then you can double-check your files’ permissions once you have them uploaded.

10. Ask your web host about potential server issues.

If all else fails, there may be a server issue, which only your host can confirm. Unfortunately, if your host’s server is experiencing a problem, you may have to wait out some website downtime.

If you’re a DreamHost client, you can check the DreamHost Status page. This resource provides you with information on all of our services.

The DreamHost status page.

If you run into any problems while trying to repair the 500 internal server error, you can always reach out to our tech support team. They’re ready and waiting to lend you a hand! If you’ve followed the tips in this guide, you’ll have plenty of valuable information for the technician.

Get Content Delivered Straight to Your Inbox

Subscribe to our blog and receive great content just like this delivered straight to your inbox.

Additional WordPress Error Reading

Want to learn more about fixing common WordPress errors? We’ve put together several tutorials to help you if you encounter any other issues.

  • How to Fix Syntax Errors in WordPress
  • How to Fix the WordPress Not Sending Email Issue
  • How to Fix the Error Establishing Database Connection in WordPress
  • How to Fix WordPress Error 404 Not Found
  • How to Fix the Sidebar Below Content Error in WordPress

Let’s Get Your WordPress Website Back on Track

While having to sort out a 500 internal server error isn’t exactly fun, it’s also not as painful as you might imagine. With a little patience and the tips we’ve provided, you should be able to make some progress on getting your website back online.

You can start small by refreshing your page and clearing your browser cache. Then you might want to move onto more involved fixes, such as increasing your PHP memory limit. If you’re not able to resolve the error on your own, DreamHost’s award-winning tech support is just a click away.

When you do run into errors, it’s easier to get back up and running when you have a reliable hosting provider. DreamPress is fast, secure WordPress hosting with powerful features to help make your site a success!

Большинству из нас, будь то разработчики, дизайнеры или даже конечные пользователи, приходилось хотя бы раз в жизни пережить. То есть болезненный процесс получения внутренней ошибки сервера и попытки ее исправить. Многие люди не хотят знать больше – они просто хотят это исправить. Но если вы не попытаетесь хотя бы понять это, вам придется чаще страдать от этой участи. Ошибка внутреннего сервера 500 очень важна, поскольку она полностью останавливает все процессы и может вывести из строя весь ваш сайт. Так что, если мы когда-нибудь захотим от него избавиться, нам нужно сначала лучше понять, что это значит.

В этой статье я расскажу, что означает эта ошибка, как определить проблему и, конечно же, как ее исправить. Но прежде чем начать, я хочу провести вас через различные существующие ошибки http (сайта) и то, что они потенциально могут означать. Если хотите, можете сразу перейти к тому, как исправить ошибку WordPress 500.

Общие коды состояния и ошибок HTTP

Перво-наперво – я собираюсь объяснить, что на самом деле означают эти ошибки. В настоящее время существует список состояний и ошибок для HTTP, к которым можно получить доступ, чтобы лучше устранить проблему. Эти ошибки обычно делят по типам. Итак, чтобы сократить этот вопрос, мы рассмотрим наиболее важные ошибки и информационные коды состояния, которые вы найдете при работе со своим сайтом WordPress.

100x ответ (статус)

Этот тип ответа предоставляется непосредственно веб-сервером. В зависимости от вашей хостинговой компании ответ может быть предоставлен Apache, nginx или любым другим веб-сервером, который использует компания. Этот тип ответа не связан с ошибками. Обычно они используются, чтобы указать, что соединение установлено. Это коды состояния ответа на соединения.

200x ответ (успех)

Я называю их успешными. Такой ответ всегда свидетельствует об успехе. Это означает, что либо сервер успешно подключился к вам, что запрашиваемые ресурсы были предоставлены правильно, либо было установлено прокси-соединение.

Самый распространенный успешный код известен как 200 OK. Вы можете увидеть примеры этого, если используете инструмент тестирования скорости WordPress, скажем, в Pingdom Tools, и пытаетесь узнать FTTB (первый раз в байтах). Ответ 200 OK всегда выдается на первый сделанный запрос.

300x ответ (перенаправления)

Ребята перенаправления. Эти коды всегда передаются, если данная ссылка переадресовывается. 300 кодов состояния указывают на успешное перенаправление и также не считаются ошибкой.

Предположим, у вас есть сайт SSL (HTTPS), и у вас также есть прямой доступ к HTTP (незащищенный), и вы хотите перенаправить всех на HTTPS-версию своего сайта. Вы можете создать перенаправление для всех запросов, поступающих с HTTP, на HTTPS. Если вы случайно попытаетесь зайти на свой сайт по HTTP, ваш браузер получит ответ 300, указывающий на перенаправление на версию HTTPS.

Как исправить внутреннюю ошибку сервера WordPress 500

Другой распространенный пример, с которым вы, возможно, знакомы, – это локальные перенаправления для SEO. Возможно, вы удалили старые сообщения или страницы. С помощью такого плагина, как Yoast SEO, вы можете 301 перенаправить их на новые, более релевантные страницы. Или используйте временное перенаправление 307, если вы работаете над обновлением и хотите ненадолго перенаправить пользователей на другую страницу.

Ответ 400x (ошибки клиента)

Известные клиентские ошибки. Эти типы ошибок связаны с проблемами в вашем браузере. Как правило, не удается загрузить определенный актив (наиболее известной является ошибка 404). Это коды ошибок, которые не считаются серьезными.

Та же ошибка может появиться, если вы попытаетесь получить доступ к несуществующему изображению на вашем сайте. Например, вы можете использовать перенаправление 410, чтобы сообщить поисковым системам, что контент был окончательно удален, или 451, если вы сделали страницу недоступной по юридическим причинам (например, по запросу DMCA).

Ответ 500x (ошибки сервера)

И вот мы подошли к нашему главному герою. 500 ошибок. Как видите, это важные ошибки, которые всегда связаны с самим сервером. Ошибки сервера важны, потому что они могут привести к сбою вашего сайта. Из этих ошибок наиболее важными являются:

  • Услуга A 503 недоступна
  • Ошибка 502 неверного шлюза
  • Внутренняя ошибка сервера 500

Давайте рассмотрим 3 из них в порядке важности.

сервис 503 недоступен

Наименее серьезным является недоступность службы 503. Если эта ошибка появляется, у вас проблема с ресурсами на веб-сервере. Почти всегда это появляется, когда ваш сервер перегружен. Проще говоря, если вы видите эту ошибку, знайте, что она временная и напрямую связана со слишком большим объемом трафика, и это приводит к перегрузке процессора. Когда ЦП и сам веб-сервер не могут обрабатывать больше входящих подключений, потому что он достиг 100% загрузки ЦП, вы увидите это всплывающее окно с ошибкой.

Вы можете исправить это, либо переключившись на лучший веб-сервер (например, с Apache на Nginx), либо внедрив плагин кэширования WordPress на свой сайт.

502 Неверный шлюз

Это то, что я назвал ошибкой неправильной конфигурации. Эта ошибка не появляется без причины. Если у вас когда-либо возникала эта ошибка, скорее всего, причина в том, что вы что-то сделали, но сделали это неправильно. Обычно это происходит, когда люди пытаются настроить Apache и конфигурацию PHP или при попытке оптимизировать nginx. Плохой шлюз – это ошибка, которая почти всегда возникает, когда PHP FPM (Fast Process Manager) теряет соединение. Либо из-за неправильной настройки, либо из-за сбоя процесса. Это приводит к тому, что веб-сервер отвечает неверным шлюзом.

Самый простой способ исправить эту ошибку – дважды проверить конфигурацию PHP-FPM, поскольку это наиболее вероятная причина этой ошибки. Это происходит чаще на стороне Nginx, чем на Apache, и почти никогда не происходит на службах хостинга, предоставляемых cPanel или Plesk. На последних двух панелях предусмотрены меры предосторожности для предотвращения ошибки неправильной конфигурации. Но это происходит очень часто при управлении собственным VPS.

Нужна дополнительная помощь с этим? Следуйте нашему руководству о том, как исправить ошибку 502 неверного шлюза.

500 – внутренняя ошибка сервера

Большой плохой мальчик ошибок. Внутренняя ошибка сервера 500 – худшая из них, прежде всего потому, что это такая общая ошибка. Если у вас нет достаточных знаний о том, как с этим бороться, это может стать настоящей болью, поскольку может вывести из строя весь ваш сайт. Ошибка 502 неверного шлюза также вызывает сбой вашего сайта, но ее легче диагностировать и исправить. Как уже упоминалось, это почти всегда связано с конфигурацией FPM.

Причины 500 внутренних ошибок сервера и способы их устранения

Первое, что нужно понять об ошибке 500, – это то, что она может быть вызвана рядом различных факторов, которые почти всегда связаны с сбоями в выполнении кода. Вместо того, чтобы пытаться диагностировать все сразу, я дам вам список ошибок по типу проблемы и тому, что вы делали.

  • Путем переноса старого сайта на новый хостинг
  • Ошибка в .htaccess в конфигурации apache
  • Ошибка выполнения PHP-кода

Существуют и другие, менее распространенные случаи, которые могут вызвать внутреннюю ошибку сервера 500, но для простоты и удобства использования этой статьи я сосредоточусь на этих трех.

1 Перенос старого сайта на новый хостинг

Эта ошибка может появиться несколькими способами, но почти всегда кажется, что это связано с версией PHP, привязанной к вашему веб-серверу. Более новые версии PHP могут немедленно вызвать внутреннюю ошибку сервера 500, если текущий сайт или плагины не поддерживают текущую версию.

Эта ошибка является классической, например, когда вы переносите свой сайт с посредственного хостинга со старой версией PHP на более новый хостинг, который принимает только более новые версии (7.0 и выше). Если ваш сайт не обновлялся в последнее время, возможно, проблема связана со старым плагином. Я называю это «внутренней ошибкой сервера миграции», потому что это почти всегда происходит при миграции сайта.

Решение

Лучший способ исправить эту ужасную ошибку, когда вы так сильно пытаетесь перенести свой сайт WordPress на новый хостинг, – это сделать полную копию ваших плагинов и темы вашего сайта. После этого удалите все плагины со своего сайта и попробуйте еще раз. Если ошибка исчезнет, ​​почти гарантировано, что ошибка была сгенерирована более новой версией PHP на вашем хостинге, которая просто отказывается выполнять код в вашем более старом плагине. Повторно загружая один плагин за раз, вы можете легко узнать, какой из них вызвал проблему.

Эти ошибки почти всегда проявляются при переносе старых сайтов, работающих на PHP 5.4 и 5.6, на новый хостинг с PHP 7.0, 7.1 или 7.2.

То же самое относится и к вашей теме. Поскольку темы могут реализовывать и реализуют дополнительный PHP-код в файлах functions.php, single и page.php. Скорее всего, более старая тема без обновлений может сломать ваш сайт после переноса на хостинг с более новой версией PHP. Эта ситуация прискорбна, поскольку единственный способ исправить это – изменить тему и перестроить ваш сайт. Это наихудший сценарий.

2 Ошибка конфигурации .htaccess Apache

Допустим, вы настраивали плагин, и вдруг все вылетает. Если вы получаете внутреннюю ошибку сервера 500 при настройке, например, плагина кэширования или любого плагина, связанного с оптимизацией, вам необходимо проверить, добавил ли плагин дополнительный код в ваш файл .htaccess.

Поскольку apache можно изменять в реальном времени, настраивая функции в файле .htaccess (который почти всегда скрыт), неправильная конфигурация может нарушить работу вашего сайта.

Решение

Чтобы исправить это, либо войдите в свой сайт через FTP и измените файл .htaccess, либо путем прямого редактирования, например, с помощью проводника файлов на cPanel или Plesk.

Если вы не знаете, как отменить то, что сделал плагин, и вам снова нужен ваш сайт, сделайте копию существующего содержимого в виде текстового файла. Сохраните это как резервную копию. Затем замените весь .htaccess следующим кодом:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule. /index.php [L]
</IfModule>
# END WordPress

Это файл .htaccess WordPress по умолчанию. Он должен работать с любым сайтом. Итак, если вы в отчаянии и не знаете, какую часть удалить, просто удалите все и вставьте этот код. Он мгновенно вас спасет. Позже вы можете удалить плагин или попробовать настроить его снова. Теперь вы знаете, как спасти вас от этой катастрофической ошибки. По крайней мере, если это связано с .htaccess.

Если вы не знаете, связана ли это с .htaccess, или эта ошибка начала появляться, даже если вы не касались каких-либо плагинов, не рискуйте. Просто скопируйте содержимое вашего .htaccess и скопируйте приведенный выше код, чтобы попытаться диагностировать. Если это не помогло, оставьте .htaccess как есть, а затем попробуйте следующее предложение.

3 Ошибка выполнения кода PHP.

Ошибки такого типа встречаются чаще, чем вы думаете, и обычно они возникают, если плагин выполняет недопустимый код. Самый распространенный способ выполнения недопустимого кода – это попытка выполнить устаревшие инструкции. Возможно, вы пытаетесь запустить старый плагин, который был разработан для работы только с PHP 5.4 или 5.6 с PHP 7.0 или более новыми версиями. Устаревшие и недопустимые функции вызовут внутреннюю ошибку сервера, которую можно диагностировать только путем включения режима отладки WP.

Как исправить внутреннюю ошибку сервера WordPress 500

Включить wp_debug

Режим отладки WordPress предоставит вам подробную информацию об ошибке, которая остановила выполнение. Мы включаем его, изменяя значение с «false» на «true» в wp_debug внутри файла wp-config.php в корневой папке вашего сайта.

Как исправить внутреннюю ошибку сервера WordPress 500

Если вы используете Plesk или cPanel, вы можете сделать это, просто изменив это значение с помощью проводника и отредактировав wp-config.php. Вы также можете следовать этому руководству по отладке от Blogvault, чтобы получить более подробные инструкции.

Как только файл будет отредактирован, вы сможете увидеть фактическую ошибку, которая остановила выполнение. В ошибке также будет указан путь и файл, в котором это произошло, поэтому легко догадаться, какой плагин вызвал ее. При отключении его можно пропустить ошибку, а затем обновить плагин или удалить его, в зависимости от ситуации.

Решение

Подавляющее большинство случаев внутренней ошибки сервера 500 связано с более старыми версиями тем или плагинами. Переключив вашу тему на любую стандартную тему WP, вы сможете восстановить доступ к своему сайту. Отключение конфликтующих плагинов также вернет вам доступ к панели управления. Если вы столкнулись с ситуацией, когда ваша тема является ответственной за нарушение работы сайта, лучший способ исправить это – создать zip-файл указанной темы из папки темы wp-content / themes / yourtheme, а затем удалить его из твой сайт. Это устранит ошибку, и вы сможете восстановить доступ к своему сайту. Затем вы можете повторно загрузить его и обновить, не активируя. То же самое можно сделать и с плагинами.

Наиболее частые ситуации для 500 внутренних ошибок сервера можно исправить обновлением. В случаях, когда для указанного плагина / темы нет доступных обновлений, вы можете попробовать переключиться на более старую версию PHP. Но знайте, что это временное решение. Новые версии PHP становятся стабильными, а старые версии регулярно объявляются устаревшими. Рано или поздно ваш сайт точно перестанет работать. Лучшим подходом всегда будет обновить или удалить / заменить соответствующие плагины.

Всегда помните, что лучше предотвратить и обновить, чем пытаться устранить повреждения позже.

Завершение нашего руководства по внутренним ошибкам сервера WordPress 500

Внутренняя ошибка сервера WordPress 500 может стать настоящей проблемой. Но в большинстве случаев их можно легко диагностировать и исправить, просто удалив / обновив конфликтующие части вашего сайта. Хотя могут быть ситуации, когда эти ошибки выходят за рамки нормы (например, при разработке плагина), это выходит за рамки цели данной статьи.

Для подавляющего большинства людей приведенный выше совет должен решить вашу проблему. Помните, что wp-debug – ваш лучший друг, и всегда внимательно следуйте инструкциям. Ваш сайт будет снова в сети в кратчайшие сроки.

Остались вопросы? Или советы по устранению внутренней ошибки сервера WordPress 500? Дай мне знать!

Источник записи: https://www.wpexplorer.com

The 500 Internal Server Error is arguably the most frustrating error you can experience with WordPress because it can literally mean just about anything. That’s not to say you can’t fix it—you can, and one of the solutions below should help you get your site back up and running.

There are a few common causes, such as having a corrupted .htaccess file, exceeding your PHP memory limit, and having improper file permissions. There are less common causes, too, including issues with your plugins or server.

Unfortunately, there’s no straightforward, 5-minute fix. Solving your 500 internal server error will require troubleshooting that will take time and patience. Typically, fixing this cryptic error will help you determine what actually caused it.

To help you, I’ve put together this troubleshooting guide. Start with the first potential fix—creating a new .htaccess file—and work through each solution before moving onto the next possible fix.

troubleshooting 500 internal server error

What is a 500 Internal Server Error?

When you visit a site, your browser sends a request to the site’s server. The server processes the request and sends back the resources to display the page, along with an HTTP header, which includes an HTTP status code.

The status code tells your browser the status of the request. For example, a 200 status code means smooth sailing—everything is OK. But if you get a 500 status code, it means something went wrong, and the server isn’t quite sure what went wrong.

Basically, the 500 internal server error code is a generic “catch-all” that means the server encountered an unexpected condition that prevented it from fulfilling the request.

There are several different types of 500 status error codes, which all mean something different, such as 501 Not Implemented, 502 Bad Gateway, 503 Service Unavailable, and 504 Gateway Timeout.

Naming Variations for 500 Internal Server Errors

There are many variations of the 500 internal server error message, depending on the many web servers and browsers available. The website you’re visiting might also have its own custom page for these errors.

Here are several variations of what you might see:

  • 500 Internal Server Error
  • Internal Server Error
  • 500 Internal server error
  • Error 500
  • HTTP Error 500
  • HTTP Error 500 – Internal Server Error
  • Temporary Error (500)

No matter which of these (or other variations) you see, they all mean the same thing—something has gone wrong and the server doesn’t know what’s happened.

How to Fix the 500 Internal Server Error

Like I mentioned above, this error indicates that something went wrong, but what the cause is a mystery. With resolving these errors, you essentially need to work backward—find the fix first and then you’ll know what caused the error.

Generally, 500 errors happen due to an issue on the server, but they can also happen due to some kind of client-side issue. So we’ll work through a number of different solutions below that involve both.

Create a Backup First

The fixes below involve tinkering with your site under the hood, i.e. making changes to your site’s root directory. So it’s critical you run a backup.

And if you don’t already have a backup plugin or some other solution in place, it’s high time you got one!

Some of my favorite tools include BackUpWordPress, VaultPress, and BackupBuddy. If you’re interested in database backups, check out WP Migrate DB Pro or simply use WP-CLI to run quick exports.

If you’re with a web host that offers backups, that’s great. But I’d recommend having your own solution that you can quickly access in an emergency without having to go through your host.

1. Check Your .htaccess File

If your site is hosted on a server running Apache, there’s a chance your .htaccess file is corrupted. This can happen after installing plugins or making other changes to your site.

It’s an easy fix. All you need to do is replace your corrupted .htaccess file with a new one.

Usually, all you need to do to create a new .htaccess file is to re-save your permalinks settings in the WordPress dashboard. But if your site is down, it’s likely you can’t log in to your site, ruling out this option.

So you’ll need to use FTP or cPanel to access your site’s files and locate your .htaccess file. For a step-by-step walkthrough on how to do this with FTP and cPanel, check out What is .htaccess and How to Use it With WordPress.

Before you go replacing your old .htaccess file with a new one, create a backup of your name. To do this, simply rename your existing file something like .htaccess-old. WordPress will then stop recognizing this file.

Refresh your site and if it loads properly, you know your .htaccess file has caused the 500 error. Now, revert your .htaccess file to its proper name—the issue will return, but now we’re going to fix it.

For WP Rocket users, you’ll need to be especially careful of what you do next with your .htaccess file because it contains performance optimization rules that you shouldn’t mess around with. So check out Resolve 500 Internal Server Error for what to do next.

If you’re not a WP Rocket user (what’s going on!?), create a new .htaccess file that includes the following, and then upload it to your site’s root directory:

create a new htaccess file

These are the rules shown in the image above:

#BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
#END WordPress

2. Increase PHP Memory limit

The cause of your 500 error could be that you’re hitting your PHP memory limit. This often happens due to poorly-coded plugins, when a site is using a lot of plugins, or when a site is using resource-intensive plugins.

All you need to do to fix this issue is increase the PHP memory limit for your site. There are a few different ways you can do this that involve updating your .htaccess file, php.ini file, or wp-config.php file.

For each of the three memory fixes below, don’t forget to refresh your site to check if it’s working so you know what’s causing your 500 internal server error.

1. Increase PHP Memory Limit in .htaccess File

Find your .htaccess file in the root directory of your site and add the following line:

php_value memory_limit 256M

This will increase your memory limit to 256 MB. If you can’t find your .htaccess, make sure you’re able to view hidden files. And if you don’t have an .htaccess file, create a new one and paste in the line above.

2. Increase PHP Memory Limit in php.ini File

You’ll find your php.ini file in the wp-admin folder in your root directory. Open it up and look for the line that starts with “memory_limit.” If it shows 64 MB or lower, replace it with this line:

memory_limit = 256M

If you can’t find your php.ini file (make sure you’ve got “show hidden files” enabled), then you’ll need to create a new file, paste in the line above, name it php.ini and save it to your wp-admin folder.

3. Increase PHP Memory Limit in wp-config.php File

If updating your .htaccess and php.ini files didn’t work, you can try increasing the memory limit in your wp-config.php file.

Add the following line to your wp-config.php file just before the “happy blogging” line:

define('WP_MEMORY_LIMIT', '256M');

Save the file and refresh your site. If it still isn’t working and you have a sneaking suspicion your plugins could be pushing your PHP memory limits, get in touch with your web host about increasing your memory on the server side.

3. Audit Your Plugins

Plugins can also cause 500 internal server errors. This includes outdated plugins causing compatibility issues and even new plugins that have been coded poorly. You might even find that you get the 500 error immediately after installing a new plugin.

To find out which, if any, of your plugins is causing your error, you’ll need to bulk deactivate your plugins and reactivate them one at a time.

deactivate wordpress plugins

If you’re unable to access your WordPress dashboard, FTP into your server and open your wp-content folder, find your plugins folder and rename it something like plugins-old—this will effectively deactivate all of your plugins.

rename plugin folder from the FTP

Then refresh your site. If it starts working, the cause of your 500 error is one of your plugins.

The next step is identifying which plugin is the culprit. To do this, rename your plugins folder back to “plugins” and then go into the folder and rename each individual plugin folder, one-by-one until you’re able to refresh your site and it works again.

When you find the offending plugin, get in touch with the plugin developer for help.

4. Check File Permissions

If none of the above has worked, you could have an issue with file permissions. Files in your WordPress directory should be set to 755 or 644 and when they’re mistakenly or accidentally set to anything else it can set off a 500 error.

To check your file permissions, FTP into your server and check your site’s directory. Here, I’m using Filezilla to access my test site and as you can see my permissions are set to 755 for folders and 644 for everything else.

checking file permission from the FTP

The WordPress Codex recommends the following file permissions:

  • All directories should be 755 or 750.
  • All files should be 644 or 640. (The exception being wp-config.php, which you can set to 440 or 400 to prevent other users on the server from reading it.)
  • Directories should never be set to 777.

If you find that a certain file has the wrong permission, just right-click it in your FTP program to access file permissions and update it to the appropriate number.

update file permissions from the FTP

Check out How to make system files (.htaccess, wp-config.php) writeable to learn more about updating file permissions.

5. Reinstall WordPress Core Files

It’s not unusual for WordPress core files to become corrupted, especially on older sites that have been customized and updated many times.

To fix this issues, you’ll need to replace your core WordPress files with fresh ones. There’s no need to re-install WordPress—simply download the latest version of WordPress and unzip the file. FTP into your site’s root directory and upload the wp-admin and wp-includes folders from the zip file you just downloaded, overwriting the older versions.

replacing wordpress core files ftp

Doing it this way, you won’t overwrite your plugins and themes.

Refresh your site. If the 500 error has disappeared, you’ve pinpointed the cause—corrupted core files.

6. Contact Your Web Host

If you’re still getting the 500 internal server error after working through each of the fixes above, it’s time to contact your web host. Your host’s server logs might be able to shed some light on what’s causing the error so it can be resolved.

Rather than skip the above and go straight to your host for help, it’s a good idea to investigate the cause of your error first. This way, you can provide your host with a rundown of what you’ve tried, so your error isn’t simply dismissed as an issue with your site’s files.

This is particularly true if you’re on cheaper shared hosting. If you’re on managed WordPress hosting, it’s usually the case that your host will help you pinpoint and fix you 500 internal server error.

Wrapping Up

This is by no means an exhaustive list of 500 internal server error fixes. What’s causing your particular issue could be just about anything. But this list will give you a head start on fixing and finding the cause (in that order!).

Lastly, don’t forget to back up your site before updating files in your root directory. If you make a change that impacts your site, you’ll be able to quickly revert to a previous backup.

Have you experienced a 500 internal server error? How did you fix it? Let us know in the comments below!

Are you seeing 500 internal server error in WordPress?

Internal server error is one of the most common WordPress errors. Since the error doesn’t give any other information, many beginners find it quite frustrating.

In this article, we will show you how to easily fix internal server error in WordPress.

How to fix internal server error in WordPress

What Causes Internal Server Error in WordPress?

Internal server error is not specific to WordPress. It can happen with any website running on a web server. Due to the generic nature of this error, it does not tell the developer anything.

Asking how to fix an internal server error is like asking your doctor how to fix the pain without telling them where the pain is.

Example of a WordPress website showing internal server error

Internal server error in WordPress is often caused by plugin or theme functions. Other possible causes of internal server error in WordPress that we know of are: corrupted .htaccess file and PHP memory limit.

We have also heard internal server error only showing up when you are trying to access the admin area while the rest of the site works fine.

That being said, now let’s take a look at how to go about troubleshooting the internal server error in WordPress.

Video Tutorial

Subscribe to WPBeginner

If you don’t like the video or need more instructions, then continue reading.

Checking for Corrupt .htaccess File

The first thing you should do when troubleshooting the internal server error in WordPress is check for the corrupted .htaccess file.

You can do so by renaming your main .htaccess file to something like .htaccess_old. To rename the .htaccess file, you will need to login to your site using FTP or File Manager app in your hosting account’s cPanel dashboard.

Once you connected, the .htaccess file will be located in the same directory where you will see folders like wp-content, wp-admin, and wp-includes.

Editing .htaccess file in WordPress

Once you have renamed the .htaccess file, try visiting your site to see if this solved the problem. If it did, then give yourself a pat on the back because you fixed the internal server error.

Before you move on with other things, make sure that you go to Settings » Permalinks page in WordPress admin area and click the save button without making any changes. This will generate a new .htaccess file for you with proper rewrite rules to ensure that your post pages do not return a 404 error.

If checking for the corrupt .htaccess file solution did not work for you, then you need to continue reading this article.

Increasing the PHP Memory Limit

Sometimes internal server error can happen if you are exhausting your PHP memory limit. Use our tutorial on how to increase PHP memory limit in WordPress to fix that.

If you are seeing the internal server error only when you try to login to your WordPress admin or uploading an image in your wp-admin, then you should increase the memory limit by following these steps:

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

Several users have said that doing the above fixed the admin side problem for them.

If increasing the memory limit fixed the problem for you, then you have only fixed the problem temporarily. You still need to find the cause that is exhausting your memory limit.

This could be a poorly coded plugin or even a theme function. We strongly recommend that you ask your WordPress web hosting company to look into the server logs to help you find the exact diagnostics.

If increasing the PHP memory limit did not fix the issue for you, then you are in for some more troubleshooting.

Deactivate all Plugins

If none of the above solutions worked for you, then this error is most likely being caused by a specific plugin. It is also possible that it is a combination of plugins that are not playing nice with each other.

Sadly, there is no easy way to find this out. You have to deactivate all WordPress plugins at once.

Follow the instructions in our guide on how to deactivate all WordPress plugins without WP-Admin.

Deactivate all WordPress plugins

If disabling all plugins fixed the error, then you know it is one of the plugins that is causing the error.

Simply go to the WordPress admin area and click on ‘Plugins’. Now you need to reactivate one plugin at a time until you find the one that caused the issue. Get rid of that plugin, and report the error to the plugin author.

Re-uploading Core Files

If the plugin option didn’t fix the internal server error, then it is worth re-uploading the wp-admin and wp-includes folder from a fresh WordPress install.

This will NOT remove any of your information, but it may solve the problem in case any file was corrupted.

First you will need to visit the WordPress.org website and click on the Download button.

Download WordPress

This will install WordPress zip file to your computer. You need to extract the zip file and inside it you will find a wordpress folder.

Next you need to connect to your WordPress website using an FTP client. Once connected go to the root folder of your website. It is the folder that has wp-admin, wp-includes, wp-content folders inside it.

In the left column open the WordPress folder on your computer. Now you need to select wp-includes and wp-admin folders and then right-click and select ‘Upload’.

Upload fresh WordPress files

Your FTP client will now transfer those folder to your server. It will ask you whether you would like to overwrite the files. Select ‘Overwrite’ and then select ‘Always use this action’.

Overwrite files

Your FTP client will now replace your older WordPress files with newer fresh copies. If your WordPress files were corrupted, then this step will fix the internal server error for you.

Ask your Hosting Provider

If all methods fail to fix internal server error on your website, then it is time to get some more help. Contact your web hosting support team and they will be able to check the server logs and locate the root cause of the error.

If you want to continue troubleshooting on your own, then see our ultimate WordPress troubleshooting guide for beginners.

We hope this article helped you fix the internal server error in WordPress. You may also want to see our complete list of the most common WordPress errors, and our beginners guide on troubleshooting WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. We have been creating WordPress tutorials since 2009, and WPBeginner has become the largest free WordPress resource site in the industry.

In WordPress, the Internal Server Error or Error 500 is one of the most annoying errors because it does not return actual data about the underlying issue. It’s hard for beginners to eliminate it. There are many different reasons for Internal Server Errors.

Download WP STAGING to avoid this and other errors in the future. The WP STAGING plugin allows you to create a copy of your WordPress site in seconds. You can test new plugins, designs, and other updates in a secure environment on that staging site.

This error is a very dreaded kind of error. It seems to always come out at a very inopportune time. An error 500 means your site is offline completely and will not be available anymore, meaning you will start losing your customers. If your site is down for more than a few hours, Google might think there is something wrong with your site. This can lead to a loss of your site’s search engine rankings.

Contents

  • 1 What is the Internal Server Error in WordPress?
  • 2 Reason Behind the occurrence of Internal Server Error in WordPress
  • 3 How to fix Internal Server Error in WordPress
    • 3.1 Reload the Page
    • 3.2 Delete the Browser Cache
      • 3.2.1 Clear Cache In Google Chrome
      • 3.2.2 Clear the Cache in Firefox
      • 3.2.3 Clear the Cache in Apple Safari
      • 3.2.4 Clear the Cache in Microsoft Edge (Internet Explorer)
    • 3.3 Check Server Log Files
    • 3.4 Check .htaccess File
    • 3.5 Increase the Server Memory limit.
    • 3.6 Check Installed Plugins and Themes
    • 3.7 Repair WordPress Core Files
    • 3.8 Contact Your Hosting Provider

In this article, we will try to resolve this error in simple steps. But first, we need to know what the Internal Server Error is to fix it properly.

The proper definition of Internal Server Error is unclear or undefined. An Internal Server Error or Error 500 is generic. It occurs when you visit a website, and your program sends a request over to the server where the site is hosted. The server receives the request, measures it, and sends back the resources (CSS, HTML, PHP, etc.) along with a header. If the status code is 200, then it means “Everything is Ok,” but if the status code is 500 (that’s why the name Error 500), there is an error. That error is caused because some code that went wrong on the website end.

The error may look like this:

Or it may look like this.

There are many different types of internal server errors with other status codes (500, 501, 501, 502, 503, etc.), but all these status codes are different but similar, so your site ends up not working as expected.

Reason Behind the occurrence of Internal Server Error in WordPress

There are many reasons for this error. In WordPress, mostly, it occurs because of the following issues:

  • Outdated or broken Browser Cache
  • Low Memory Limit
  • Broken code in Plugins and Themes Functions
  • Corrupted files in WordPress core folders
  • Corrupted .htaccess file

How to fix Internal Server Error in WordPress

We have several steps to resolve this problem:

Reload the Page

When an Internal Server Error is displayed when you are opening a website, the easiest and first thing you should do is reload the page by pressing F5. If that is not successful, press ctrl + F5.

It may be the case that the server is essentially overloaded, and the site will return properly when you refresh it several times.

Delete the Browser Cache

Another good idea is to clear the browser cache. Clearing the browser cache may solve your problem. How to clear the cache on different browsers are given below:

  • Clear Cache In Google Chrome

To clear the Chrome cache, follow the following steps:

  • From the top of the Chrome window, click on the right side.
  • Then, select more tools and, from there, enter Clear browsing data.
  • From the Time range, select All Time.
  • Then, checkmark Cookies and other site data & Cached Images and Files.
  • Then, click the Clear Data button.

These steps can be performed on any chromium-based browser, i.e., Microsoft Edge, to clear the cache.

  • Clear the Cache in Firefox

Follow the following steps to clear the Firefox browser cache:

  • Firstly, open the menu bar and then select Options from the menu.
  • Select Privacy & Security from General
  • Then from the Cookies & Site Data section, click Clear Data.
  • From the dialogue box, remove the Cookies and Site Data checkmark.
  • Clear the data with Cached Web Content checkmark

  • Clear the Cache in Apple Safari

To clear the Safari browser cache, follow the following steps:

  • Select Setting from the home screen of Safari
  • Select Clear cookies & Data from the bottom of Safari’s Setting screen
  • Clear the cache from it
  • Clear the Cache in Microsoft Edge (Internet Explorer)

To clear the Internet Explorer cache, follow the following steps:

  • Firstly, Close all the windows of Internal Explorer.
  • Open a new one and then click on Tools Box.
  • Select Internet Options from the bottom
  • From the browsing history, click the Delete button.
  • Then, from Delete Browsing History, check-marked the temporary Internet files and website files and Cookies and Website Data and click on the Delete button and then Ok.

The following steps are more complex and affect the database/files on the WordPress website. To not cause any further damage, and if you still have access to the WordPress dashboard, create a staging site with WP STAGING and try to fix the error on the staging page instead of the production site.

You can create a staging site with WP STAGING.

Check Server Log Files

When your website throws a fatal error 500, you can tell your website to write more explicit error messages into a so-called log file for debugging purposes.

You can  enable the debug mode in your WordPress by opening the file wp-config.php and adding the following lines of code into it:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

You can find the wp-config.php file in the root folder of your WordPress installation. You can use your web hosting control file manager or FTP to edit this file.

Check out that article to learn in detail how to activate the WordPress debug.log.

If this works, you will see all the relevant errors in the file debug.log. That will help you to find out what plugin or code causes the error.

You can find the logfile at the location /wp-content/debug.log in your website’s file system.

  • Please open the file and check it.

If you see some error messages related to one of your installed plugins, you can disable the plugin by renaming its folder to something like
/wp-content/plugins/plugin-name-temp/

If no results are provided in the debug.log, there is still access to the server error.log file.

Depending upon what kind of web server your hosting provider uses, you can find the server error log file in the paths:

Apache server: /var/log/apache2/error.log

or

Nginx server: /var/log/nginx/error.log

To access these files, you will need to have full access to your hosting. You can use an FTP client and troubleshoot with the help of these files. Some web hosting control panels also have more easy access to these files.

Check .htaccess File

The 500 Internal Server Error may also happen due to some faulty code in the .htaccess file. That file is located in your WordPress site’s root directory and is essential to make your website running properly.

To troubleshoot your .htaccess, we need to disable the current one and create a new one.

First of all, use FTP or the file manager app in your hosting account to connect to your site.

You can find the .htaccess file beside the folders wp-admin, wp-includes, and wp-content.

  • Rename the file to .htaccess_backup have a backup of the file if something goes wrong.
  • Please create a new file and name it.htaccess
  • Add the following lines of code into it:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

If the old .htaccess file were the reason for the error 500, this would fix the Internal Server Error for you.

Increase the Server Memory limit.

Sometimes the error 500 occurs because of the low Memory Limit of PHP in WordPress. To resolve this error, you may have to increase the memory limit. If your host provides cPanel, you can increase your PHP memory limit from the dashboard user interface.

The steps are the following:

After opening the cPanel, click on the link that says, “Select PHP version.”

Then, click on “Switch to PHP Options.”

Then, click on “memory_limit” at the bottom and change its value to something higher, usually in the range of multiplied by 2, i.e., 256, 512 and save it.

Another way is to add the line below into your wp-config.php. You can use your hosting file manager software or an FTP client to edit that file.

Just add the following line on top of your wp-config.php file.

define('WP_MEMORY_LIMIT', '256M');

If a lack of memory was your issue, then this step will fix the Internal Server Error for you.

Check Installed Plugins and Themes

Sometimes, an Internal Server Error occurs due to recently installed WordPress themes or plugins. If you recently installed a plugin or theme and it broke your site, there is a chance that you can deactivate that plugin to fix the error.

You can use the step below only if your WordPress admin dashboard under /wp-admin is still available!

  • Select all plugins, click on “Bulk-Actions,” and on “deactivate” to deactivate all plugins.

  • Activate the Plugins one by one again and reload your site after each plugin activation.
  • If you see the error again, deactivate or remove that plugin, which causes the problem.

If your WordPress admin dashboard is not available, you can disable a specific plugin by renaming its plugins folder to something else manually.

To do this, connect to your site via FTP.

For instance, if the woocommerce plugin is responsible for error 500 Internal Server Error, you’ll need to rename the folder from
/wp-content/plugins/woocommerce to
/wp-content/plugins/woocommerce-disabled.

After that step, the woocommerce plugin will be disabled, and you can reaccess your website.

If you want to disable all plugins, rename the folder wp-content/plugins and reload your site.

Then all plugins will be disabled, and your site should be reachable again.

After that step, rename the folder wp-content/plugins-tmp back to the original name wp-content/plugins.

Repair WordPress Core Files

Sometimes, especially in older sites, WordPress files can be corrupt. If the WordPress core system is corrupt, you need to repair the core files by replacing them with the original ones.

One way is to go to wordpress.org and download the latest copy of WordPress from there.

  • Once downloading, unzip it.
  • After that, connect to your host using your FTP client or using the file manager within your hosting account.
  • Replace the entire folders /wp-admin and /wp-includes within your WordPress installation with the ones from the extracted zip file.
  • To do that, rename the current folders wp-admin and wp-includes to wp-admin-backup and wp-includes-backup.  This can be done with the hosting file manager or the FTP client.

  • Upload the new directories from the unzipped file to the same location as the old directories.

If your WordPress files were corrupted, this step would fix the 500 Internal Server Error for you.

Contact Your Hosting Provider

There are a few uncommon issues with Internal Server Errors in WordPress. At this point, you have to contact your host. Sometimes, these issues can be resolved by the hosting provider by looking at the file permissions and other settings.

If this still does not solve your issue, You may have to switch to another more optimized host to run your WordPress site.

When there’s a 500 internal server error on your website, your focus goes to one thing only: How do you get your website back online as quickly as possible? Every minute – second, even – that your site is down is time that you’re losing traffic and sales. Plus, it’s not a good look for your brand, whether you run a huge company or you’re a solopreneur.

Also, a 500 internal server error that affects your site for several hours (or that happens often) can have a negative impact on your SEO rank. A site that goes down for just a few minutes may not even be recognized by Google as being offline – no problem there. However, a site that’s down for several hours tells Google that there’s a major problem that has to be taken care of, which could hurt your ranking.

Obviously, everyone wants to avoid the 500 internal server error, and when it does strike, to fix it as quickly as possible. This article should help!

  • 1
    What is the 500 Internal Server Error?

    • 1.1
      What Does a 500 Internal Server Error Look Like?

  • 2
    Common Causes of the 500 Internal Server Error

  • 3
    How to Access Your Website’s File Management Client

  • 4
    How to Fix a 500 Internal Server Error

    • 4.1
      Reload the Page

    • 4.2
      Try the Page on a Different Browser

    • 4.3
      Clear the Browser Cache and Delete Cookies

    • 4.4
      Deactivate Your Plugins

    • 4.5
      Deactivate Your Theme

    • 4.6
      Update the .htaccess File

    • 4.7
      Increase the PHP Memory Limit

    • 4.8
      Check Permissions

    • 4.9
      Reinstall WordPress

    • 4.10
      Check the Server

  • 5
    Final Thoughts About the 500 Internal Server Error

What is the 500 Internal Server Error?

According to the Internet Engineering Task Force, a 500 internal server error is defined as, “a status code [that] indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.” When you go to a website, your browser sends a request to the server, which is where the website is hosted. The server processes the request and then sends back the resources (CSS, HTML, PHP, etc.) and an HTTP header, which includes a status code. The code tells you about the status of the request – 200 means all is okay, while 500 means something is wrong.

There are several different 500-level status codes, including 501, 502, 503 and so on. Each one has its own meaning. A 500 status code, the one we’re discussing in this article, means that the server encountered something that’s keeping it from being able to fulfill the request. Depending on the server, you may get more of a code to narrow down the problem, such as 500.12, which means an application is restarting on the server, or 500.13, which means the server is too busy.

What Does a 500 Internal Server Error Look Like?

500 internal server error

Source: WordPress.org

A 500 internal server error can appear in a variety of ways, including:

  • 500 Error
  • 500 Internal Server Error
  • 500 – Internal Server Error
  • Currently unable to handle this request. HTTP ERROR 500.
  • HTTP 500
  • HTTP 500 – Internal Server Error
  • HTTP Error 500
  • Internal Server Error
  • The website cannot display the page – HTTP 500

Some brands will have a branded 500 internal server error page with messaging that they’ve written and links for more help. It’s also possible that all you’ll see is a blank, white screen, which is more common when using the Firefox or Safari browser.

Common Causes of the 500 Internal Server Error

There are a number of reasons why you may be getting a 500 internal server error, including:

  • Browser cache
  • Corrupted database
  • Corrupted .htaccessfile
  • Corrupted WordPress core or installation files
  • Database server problems
  • Incorrect file and folder permissions
  • Problem with the PHP memory limit
  • Third-party plugin or theme

How to Access Your Website’s File Management Client

Many of the solutions we’ll talk about require signing into your FTP client. An FTP client lets you to access and edit your WordPress website’s files without having to log into the WordPress dashboard – something that may be unavailable due to that 500 internal server error. We suggest using your host’s file manager – it’s the safest and most accessible option. Alternatively, you can use a separate FTP client like FileZilla, but we had a very difficult time signing in, even with all of the correct login credentials – it’s far more foolproof to use your host-provided file manager. Yours will look something like this:

How to Fix a 500 Internal Server Error

There are a number of troubleshooting steps to take when you see a 500 internal server error. Hopefully, one of the following will clear up your problem. Before you do anything, though, it’s recommended that you create a backup of your website. If you don’t already have a backup solution in place, take a look at our list of the best WordPress backup plugins.

Reload the Page

The first thing to try is reloading the page after a minute or two. If the host or server is temporarily overloaded, the site should come back quickly. It’s also not uncommon for a site to go down for a minute or so after you’ve updated a plugin or theme. This usually means the host isn’t set up properly and there’s a brief timeout after the update. Often, this problem fixes itself with a page refresh.

Try the Page on a Different Browser

Open up a different browser and see if you’re still getting the error there. If you’re loading the page fine on one browser but not another, then that tells you it’s likely a browser issue. Wait a few minutes, then reload to see if it’s worked itself out.

Clear the Browser Cache and Delete Cookies

Clear your browser cache and delete cookies. Each browser has its own (easy) steps to follow for these processes, so it’s best to look up the instructions for the browser you’re using if you can’t find the options quickly (the image below shows where to find the settings in Chrome). Restart the browser, and then try the webpage again.

500 internal server error

Deactivate Your Plugins

To see if a plugin is causing the problem, deactivate them one by one, then test the website to see if you’re still getting the error. Go to Plugins in the left sidebar of your dashboard, then click Deactivate under the plugin name. After deactivating each plugin, it’s a good idea to log out of WordPress, clear your cache and restart the webpage.

If the error is making it difficult to access your WordPress admin panel, you can log in to your FTP to manage the plugins that way. Find the plugins folder – mine was in wp-content, and rename the folder to plugins_old. If that solves the problem, then you know one of the plugins is to blame. Change the folder name back to the original plugins, then rename the plugins one by one and refresh your website until the error clears.

Deactivate Your Theme

It’s also possible that your active theme is causing the error. Switch to the default WordPress theme to see if that solves the problem. Go to Appearance in the left sidebar of your WordPress dashboard, then select Themes. Hover over the theme you want to activate, then click Activate, which will deactivate the current theme.

Don’t have the latest WordPress theme installed yet? From your Themes page, click Add New, then look for the most recent WordPress theme, which will be named with the current year. Hover over it, and click Install.

500 internal server error

If you can’t access your WordPress dashboard, go into your FTP and look for the themes folder. Find the folder for your active theme and rename it, just like you did in the above step with the plugins. If this gets rid of the error, then you know it’s your theme causing the problem, and you should choose a new one.

Update the .htaccess File

It’s not uncommon for your WordPress site’s .htaccess file to become corrupted. To see if this is the problem, start by logging into your FTP. Find the .htaccess file and rename it to .htaccess_old. Reload your site to see if the error message has cleared. If it has, you know the .htaccess file was causing the error.

Go into your WordPress admin dashboard and head to Settings > Permalinks. To reset the permalinks, which create a new, uncorrupted .htaccess file, select Plain and click Save Changes at the bottom. Then change the permalink structure to whatever you want and click Save Changes again.

If you still can’t access your dashboard, go through FTP. Open the file and make sure it looks like this – if it doesn’t, update it to get rid of any problematic code.

500 internal server error

Increase the PHP Memory Limit

If the 500 internal server error is being caused by too little memory, you’ll want to increase the memory limit to see if that takes care of it. While you can head into your FTP to make this change, some hosts don’t allow users to fiddle with the memory limit, so it’s best to check with them first and let them handle it for you if they can.

Check Permissions

It’s possible that there’s a permissions error with a file or folder. These are the general rules to look for as you scan for permission errors:

  • Directories should be 755 (or drwxr-xr-x) or 750
  • Files should be 644 (or -rw-r-r-) or 640
  • It’s possible that wp-config.php will be 440 or 400 for security measures

Reinstall WordPress

You can reinstall WordPress core without affecting your site’s other content. You can do this from your admin dashboard or through FTP.

If you’re able to access the dashboard, go to Updates > Re-Install Now. The latest version of WordPress will be downloaded and reinstalled automatically.

If you have to use FTP, the process isn’t too difficult.

  • Download the most recent WordPress version here.
  • Open the ZIP file to extract the contents.
  • In the unzipped folder, delete the wp-content folder.
  • In your FTP client, upload the to your root folder, which may be the name of your website on certain hosts or public or public_html.
  • If you get a prompt that says something like, “Target file already exists,” opt to overwrite it.

Whichever process you chose – the WordPress admin dashboard or FTP – you should now have a fresh installation of WordPress core, and you can see if that cleared the 500 internal server error.

Check the Server

Still getting the dreaded error message? Depending on your host, you may be able to check the error logs. This may clue you in to exactly what’s going on – like a plugin error, for example – so that you know what to fix to clear the error. Depending on how much support your hosting service offers, they may even be able to take care of it for you.

Final Thoughts About the 500 Internal Server Error

The 500 internal server error can occur on any page of your WordPress website, and figuring out what’s causing it and how to solve the problem is nothing less than a mystery. From root directory problems to a problematic server, there’s no straight answer as to what causes this type of error.

If all else fails, get in touch with your host to find out if they’re having server trouble – which could mean it’s on their end instead of yours (you may also want to do this as a first step to avoid troubleshooting).

We also have an article about how to fix the “error establishing a database connection” message you may be getting. Check it out here.

Themeisle content is free. When you purchase through referral links on our site, we earn a commission. Learn More

Internal server errors in WordPress are the worst (aka. http error 500), compared to other HTTP error codes and status codes. They provide no real information about the problem and are rarely actual server errors (ie: usually your server is working fine).

In this article, I’ll try to make sense of this internal server error in WordPress and show you how to get rid of it:

The web definitions of the 500 internal server error are rather unclear. Basically, there’s no real indication as to what really went wrong and caused the error.

The only thing that’s certain is that the error is caused by some operation that went wrong on the website’s end. Particularly in WordPress’ case, this can mean that a script that’s part of a theme or a plugin did something it shouldn’t have done, and now your server has crashed.

Don’t sweat, though, there are some good solutions…

How to resolve 500 internal server error

Most of the time, you can have the 500 internal server error solved in 6 steps:

1. Turn on debugging

Whenever WordPress throws you a white screen of death or a server error, I recommend turning your debugging on. While this may not fix the problem, it may give you more insight into what’s going on.

You can turn debugging on by editing your site’s wp-config.php file. Once you’ve accessed this file, search for WP_DEBUG within. If you find it, you should be able to set it to “true”. If you don’t see it in there, you’ll need to create it yourself. Either way, at the end of the day, you should have a line that looks like this:

define( "WP_DEBUG", true );

Once saved, reload your site to see if anything has changed. If you’re lucky, the server error may disappear and might be replaced with a different error, one that actually tells you where the issue is.

If this is the case, take a look at where the error is located. If it is within a plugin folder, disable that plugin, the error should go away.

Even if turning on debugging doesn’t give you a great result, it is a good idea to leave it turned on until the issue is resolved. It will give you and any developers more insight into what’s going on. Don’t forget to turn debugging off once everything is a-ok and you’re done with the maintenance!

2. Deactivate all plugins and switch themes

If you have access to your dashboard, you should deactivate all your plugins and see what’s what. If your website loads without the server error the issue was with one of your plugins. You can switch them on one-by-one to figure out which one caused the issues.

You can also switch your theme to a default, unaltered WordPress theme like Twenty Fifteen or Twenty Sixteen. If the site loads without the internal server error, the issue was within your theme.

I’ve noticed that quite a few of these errors are actually caused by plugins, so this will be your best bet.

3. Check your .htaccess file

The .htaccess file, if it exists, contains a number of rules that tell the server what to do in certain circumstances. It is commonly used for rewriting URLs or preventing access to your site for malicious intent.

Use your FTP editor and check if you have an .htaccess file in your WordPress root folder. You may need to make sure your FTP editor lists hidden files before you do this.

If there is an .htaccess file there, make a backup and then delete all the contents within, or the whole file. This may remove some important rules, but if the internal server error was caused by a mistake within the file, this will tell you.

If the error is now resolved, the issue was with the .htaccess file. Try restoring the file and then deleting blocks of it. If at some point the site starts working, you know which block the issue is in. You can narrow it down to a single line like this usually. You can then remove that line or ask your developer or your host for further assistance.

4. Increase your memory

I’ve never personally run into this issue, but I’ve heard that increasing your memory limit may help – I assume this is more of an issue in shared environments. To get this done, open your wp-config.php file in the WordPress root directory and search for WP_MEMORY_LIMIT. If it exists, change the value to something like “64M”. If it doesn’t, paste the following line into the file:

define('WP_MEMORY_LIMIT', '64M');

If this works then you’ve only solved the issue temporarily. Chances are that you have a faulty bit of code somewhere (which could be a third party plugin) that is exhausting your resources. If your host has monitoring available, take a look at your resource usage with various plugins on/off to get a better idea of what is wasting those precious megabytes.

5. Ask your host

There are a few uncommon issues which can lead to internal server errors in WordPress, but at this point it may be best to ask your host. The issue could be a genuine server issue, which they can at least confirm and they can also look at things like file permissions and other sources.

Or, you might just want to switch to a better host that has servers that are more optimized to run WordPress sites. This doesn’t have to be expensive. There are hosts that give you an okay WordPress experience for as little as $0.8 a month.

6. Reinstall WordPress

I shouldn’t think this would help in most cases, but there are some edge cases where a reinstall of WordPress could fix the issue. It may even fix file permission problems along the way.

To get this done, I recommend following the manual WordPress Update instructions in the WordPress Codex, or Themeisle’s own guide to installing WordPress.

Summary

Internal server errors in WordPress are usually not caused by actual server faults. Most of the time, they can be corrected relatively easily using the methods described above. If in doubt, always ask your host, they have far more sophisticated tools than you do to locate and fix issues.

I always recommend switching on debugging while you’re working things out and ruling out plugin and theme issues since this is what any support technician would ask your to do first, or they would do it themselves.

Free guide

5 Essential Tips to Speed Up
Your WordPress Site

Reduce your loading time by even 50-80%
just by following simple tips.

Download free guide

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Ошибка сервера 500 internal server error wordpress elementor
  • Ошибка сервера 500 error elementor как исправить
  • Ошибка сервера 451 temporary local problem please try later
  • Ошибка сервера 405
  • Ошибка сервера 403 что значит

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии