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 досадна – особенно потому, что причины ее появления часто неясны, а единственного простого решения не существует. Приведенные в этой статье методы не требуют навыков программирования, но в большинстве случаев помогут решить возникшую проблему.

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

Мар 15, 2023

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 хостинг со скидкой до 81%!

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

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

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

  • Доступ к панели управления вашим хостингом
  • Доступ к панели управления 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 — Начать всё заново

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

Заключение

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

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

Author

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

Ошибка 500

Внутренняя ошибка 500 — Internal Server Error

Ошибка с кодом 500 (internal server error) – внутренняя ошибка сервера.

500я ошибка

Значение 500 — код статуса протокола HTTP. Причина ошибки с таким кодом — неисправность конфигурации сервера, либо появление информации о том, что произошел отказ компонента. При ошибке 500 программное обеспечение работает, но есть серьезные внутренние проблемы, которые мешают запросам правильно обрабатываться.

Такая ошибка появляется у построенных на разных CMS сайтах.

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

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

Мы предлагаем бесплатный перенос Ваших проектов с другого хостинга на наш.

Ошибка 500 — внутренняя, поэтому если она возникла на нужном для просмотра сайте, то можно только посетить его позже, когда восстановят работоспособность.

Причин, по которым появляется ошибка 500 — огромное количество. Задача сводится к поиску и устранению неисправности.

Неправильные права доступа

Частая причина возникновения ошибки – установка неправильных прав доступа на файлы скриптов — 777. Из-за этого они блокируются сервером. Такая настройка разрешает всем вносить изменения в файл, что недопустимо с точки зрения обеспечения безопасности. В случае, когда требуется установить такие права, поставщик всегда сообщает об этом заранее.

Как исправить?

С помощью файлового менеждера (на скриншоте — бесплатная программа FileZilla) просмотреть права доступа к файлу или папке на сервере.

меняем права доступа к файлу

В первую очередь надо проверить, каким образом настроены права доступа. Для каждого типа элементов они проверяются индивидуально. Для папок рекомендуется значение 755, для скриптов — 600, а для других файлов — 644.

Оптимальное решение — один человек. который может управлять аккаунтом. Не желательно давать кому-либо права доступа к корневым папкам сайта.

Высокая длительность работы скрипта

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

Как исправить?

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

Ошибки htaccess

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

Как исправить?

меняем права доступа к файлу

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

Кроме того, есть возможность посмотреть сведения о появившихся ошибках. Ошибки сервера заносятся в специальный файл «error.log». В нем нужно найти строки о том, какая из директив ошибочна. Например, информация «Invalid command ‘RewritRule’» говорит о том, что директива «RewritRule» написана с опечаткой. Исправление на «RewriteRule» убирает эту ошибку.

Нехватка памяти для работы кода

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

Эта функция предотвращает большую нагрузку на сервер со стороны каждого аккаунта.

Как исправить?

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

Тарифы виртуального хостинга с выбором периода предоплаты от 1 месяца до 3-х лет.

Ошибка в cgi скрптах

Ошибка 500 чаще появляется из-за ошибок в «htaccess», но еще одна её причина – неправильная работа с CGI-скриптами.

Как исправить?

Существует три основных правила, которые могут быть нарушены.

  • Формат окончания каждой из строк — UNIX (n), а не Windows (rn). Для обеспечения такого условия их загрузка проводится по FTP в режиме ASCII.
  • Права доступа для скриптов CGI и папок, где они хранятся — 0755. Такая настройка разрешает процедуру записи исключительно владельцу, чтоб правильно с позиции безопасности.
  • При работе скрипта CGI могут появиться неправильные HTTP-заголовки ответа. Следует проанализировать содержимое файла «error log» на предмет ошибок.

Ошибка 500 при использовании WordPress

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

Файл «.htaccess» используется WordPress в случае, когда обычная структура ссылок была изменена на ЧПУ. Помимо этого, его используют плагины WordPress, которые осуществляют резервное копирование и некоторые другие функции.

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

  • движок;
  • тема;
  • плагины, которые активированы.

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

Мы предлагаем бесперебойный WordPress хостинг, оптимизированный под создание сайтов на этой CMS.

Поочередная проверка элементов позволяет отследить, какой из них — причина ошибки. В процессе поиска неисправности постоянно проверяют, не исчезает ли ошибка 500:

  • сменить тему и проверить наличие ошибки;
  • по очереди деактивировать плагины и следить за изменениями;
  • поиск ошибок в сторонних скриптах;
  • поиск проблемы в движке WordPress.

Сбои плагина иногда видно по искажению внешнего вида сайта. Возможно наличие ошибок в работе конкретного плагина или его конфликт с остальными.

Если файл «.htaccess» – не причина проблемы, нужно убедиться, что скрипты работают с нормальной скоростью. Поиск медленно работающиех скриптов можно выполнить самостоятельно, либо попросить помощи у специалистов службы технической поддержки. Файл с обнаруженной ошибкой и временем ее появления отражается в файле «Error Log».

отключаем плагины WP

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

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

Увеличить объем памяти возможно путем корректирования файла. В корне хостинга нужно найти «wp.config.php» и после последней строки добавить в него код:«define(‘WP_MEMORY_LIMIT’, ’64M’».

В ряде случаев помогает обновление WordPress до последней версии.

Ошибка 500 при входе в административную панель Joomla

Ошибка 500 иногда возникает после ввода логина и пароля для панели администрирования Joomla – «админки». При этом работоспособность сайта сохраняется. Код ошибки не указывает на конкретную проблему, поэтому требуется её самостоятельный поиск.

Как исправить?

В журнале ошибок хранятся сообщения об ошибках. Он называется «error.php» и лежит в каталоге «logs». При поиске ошибок, которые появились недавно, важно обратить на последние записи в этом файле. Там содержатся сведения о нарушениях в работе модулей, если они происходили.

Другая вероятная причина ошибки — невозможность записи в каталоги «logs» и «tmp». Возможно, потребуется установка полных прав для этих каталогов – 777.

Рекомендуется проверить правильность путей к каталогам «logs» и «tmp» в файле конфигурации «configuration.php». Желательно указать полные пути к этим каталогам.

Если проблема сохраняется, рекомендуется проверить корректность файла «htaccess» и по очереди отключить и включить все логины и плагины через базу данных. В «htaccess» возможны ошибки, опечатки и лишняя информация. Например, ошибка 500 появляется из-за того, что не закомментирована строка Options +FollowSymLinks. При редактировании файла можно не удалять, а комментировать строки и проверять, как изменяется после этого работа сайта.

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

iPipe – надёжный хостинг-провайдер с опытом работы более 15 лет.

Мы предлагаем:

  • Виртуальные серверы с NVMe SSD дисками от 299 руб/мес
  • Безлимитный хостинг на SSD дисках от 142 руб/мес
  • Выделенные серверы в наличии и под заказ
  • Регистрацию доменов в более 350 зонах

Сообщение об ошибке сервера 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

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

В большинстве случаев, ошибка 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 сервера.

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.

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

В этой статье рассмотрим, от чего возникает ошибка 500 Internal Server Error в WordPress, как можно оперативно исправить её и как не допустить в будущем.

Оглавление

  • 1 Что значит ошибка 500 Internal Server Error в WordPress
  • 2 Проблема в плагине
  • 3 Проблема в теме
  • 4 Проблема в .htaccess

Что значит ошибка 500 Internal Server Error в WordPress

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

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

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

Проблема в плагине

Часто ошибка 500 на WordPress возникает из-за плагина. Если вы видите, что ошибка появилась после установки или обновления какого-либо плагина, то вероятно, в нём и дело. Проверить это можно легко.

  • Если у вас есть доступ к консоли сайта, то перейдите в раздел «Плагины» и деактивируйте плагин, который перед ошибкой был установлен или обновлён. Если сайт после этого восстановился, то данный плагин вам лучше не использовать, удалите его.
  • Если доступа к консоли нет, то перейдите к файловому менеджеру вашего хостинга, и откройте в каталоге вашего сайта папку wp-content/plugins Здесь у каждого плагина своя папка, которая наименована чаще всего именем плагина. Чтобы деактивировать отсюда плагин, переименуйте его, например, добавив к его имени цифру 1. Сделайте это с тем плагином, который перед ошибкой был установлен или обновлён. И если сайт после этого восстановится, то можно удалить папку этого плагина и не использовать его. Если сайт не восстановился после этого, то папке нужно вернуть прежнее имя, убрав 1, значит плагин не причём.

Причина в плагине может быть из-за того, что он не совместим с текущей версией WordPress, активированной темой или другими плагинами.

Проблема в теме

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

  • Если есть доступ к консоли, то перейдите в раздел «Внешний вид», и активируйте какую-либо другую тему. Если после этого сайт восстановился, то проблема в теме. От неё придётся отказаться.
  • Если доступа к консоли нет, то перейдите к файловому менеджеру вашего хостинга, и откройте в каталоге вашего сайта папку wp-content/themes Здесь у каждой темы своя папка, которая наименована чаще всего именем самой темы. Переименуйте папку активной темы, добавив к её имени, например, 1. Тогда активируется тема, которая установлена в WordPress по умолчанию (если вы её не удалили). Если после этого сайт станет доступным, то папку с темой можно удалить — значит она вызывает ошибку, и придётся использовать другую тему. Если проблема осталась, то папке нужно вернуть прежнее имя, убрав 1. Значит тема не причём.

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

Проблема в .htaccess

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

  • Во-первых, следует убедиться, что он вообще есть и наименован именно так — .htaccess Точка в начале имеет значение. Вы могли случайно удалить его или переименовать.
  • Во-вторых, у этого файла должно быть правильное содержимое. По умолчанию в WordPress он имеет такое содержимое. Можно скопировать содержимое файла из официального сайта WordPress и вставить в свой файл, если оно отличается. Содержимое файла могло измениться по двум причинам: вы могли сделать это сами случайно или это сделал какой-либо плагин.

Два этих способа помогут, если проблема в файле .htaccess.

Nov 23, 2022

Domantas G.

7min Read

How to Fix HTTP Error 500 in WordPress (Internal Server Error) – 10 Solutions that Work

Running into the 500 Internal Server Error in WordPress? Well, you’re not alone. 500 Internal Server Error or HTTP Error 500 is one of the most common issues WordPress webmasters encounter.

However, catching the cause behind this error is not as easy as some of the other commonly encountered HTTP errors. Here is a quick tutorial on fixing WordPress HTTP error 500 using 10 different methods. Let’s check it out.

Error code HTTP Error 500
Error type Code error
Error variations 500 Internal Server Error
HTTP 500
Error 500
HTTPS 500 error
Temporary Error (500)
HTTPS error 500
HTTP Error 500 – Internal Server Error
The website cannot display the page – HTTP 500
Error causes Corrupted .htaccess file
Corrupted or incompatible theme
Corrupted or incompatible plugin
Incompatible PHP version
WordPress updated version incompatible with other elements

Fixing 500 Internal Server Error WordPress

Here are 10 different causes and solutions to fix WordPress 500 Internal Server Error:

Important! Before proceeding with this tutorial, we recommend making a backup of your site to prevent any file loss during the changes.

1. WordPress 500 Internal Server Error Due to Bad Plugins

In most cases, WordPress HTTP error 500 occurs because of a new plugin. If your page experiences issues after a new installation or update, then you can easily fix it by deactivating or removing the plugin.

There are two easy ways of doing this: through the WordPress dashboard or File Manager.

If you are still able to access WordPress from your hPanel, do so and select Plugins.

  1. You should see a list of Installed Plugins. From here, click on all of the green Active buttons and change all of the plugins to Inactive.
  2. One by one, make each plugin Active again and test your site after each one.
  3. If your site is fine, keep it Active. If you see the error, you know which plugin is causing the problem.

Activating WordPress plugins in hPanel.

If you don’t have access to your dashboard, you can also disable or remove plugins through File Manager on your hosting control panel. Here we’re using Hostinger’s hPanel as an example:

  1. Login to Hostinger hPanel and navigate to File Manager under the Files area.
  2. Click on the public_html folder and select the wp-content directory.
    right click to rename a plugin
  3. Open the Plugins folder and locate the bad plugin. Then, right-click to Rename.
  4. Rename its directory by adding disabled after the plugin name to turn it off. rename a plugin by adding the word disabled
  5. Finally, refresh your website to see if it works.

In case the problem persists, repeat the process until all plugins are deactivated or until your website is working again. Once you find out which plugin caused the server error 500, remove it completely and either reinstall it or try to find a substitute that performs the same.

2. WordPress 500 Internal Server Error Due to Themes Installation

A new theme or update is another common cause of HTTP status code 500. To fix it, simply change the existing theme to a new one or change it to one of the default options.

If you can access the WordPress admin area, try to change the WordPress theme.

Alternatively, you can also change themes by editing the MySQL database via phpMyAdmin in the control panel. Here’s how to do it with the hPanel:

  1. Navigate to phpMyAdmin in the hPanel.
  2. Once you open it, head to the wp_options table.
  3. Locate the template and stylesheet rows.
  4. Click Edit and change the template and stylesheet value with a default theme like Twenty Twenty, and press Go to save changes.

Now, reload your site with the new theme and see if it fixed the issue.

Important! To see a list of installed themes on your database that can be used to change the existing one, go to the wp-content/themes directory using File Manager.

3. WordPress 500 Internal Server Error Due to Corrupted .htaccess File

Another way to get rid of the server error 500 is to check your current .htaccess file and make sure that it’s not corrupted. However, you can also just create a completely new one. Here’s what you need to do:

  1. Open the File Manager and look for .htaccess in the public_html folder, then disable the file by giving it a different name.Disabling .htaccess file by renaming it
  2. Once it’s disabled, go on the upper part of the page and create a new .htaccess file.
  3. Right-click on the new file and select Edit.
  4. Copy-paste the default WordPress .htaccess code in the new one.The default WordPress code in the .htaccess file
  5. Click Save, and that’s it. You now have a brand new .htaccess file.

4. Insufficient PHP Limit

A memory limit or insufficient PHP value can be another reason behind the issue in WordPress, as scripts and plugins require a certain amount of memory to work.

To fix the memory limit, increase the PHP limit by editing the .htaccess file manually. Here are the lines that we recommend adding:

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

Once done, refresh your website. If your HTTP status code 500 is related to insufficient PHP values, this solution will fix the error.

5. Incompatible PHP Version

Some plugins and scripts require a specific PHP version to work properly. If the requirements are not met, the HTTP 500 Error may appear.

To change the PHP version via the hPanel, simply log in and head to the PHP configurations under the Advanced tab.

In case you don’t know what PHP version is needed, try upgrading or downgrading. Don’t forget to save the settings and refresh your website after each change.

Selecting the correct PHP configuration for your WordPress site.

If it still doesn’t fix the issue, change your PHP version to the initial one (which was used at the beginning) and proceed to the next option.

6. Enabling Error Display

Finding the reason for the WordPress 500 Internal Server Error is arguably the toughest part of fixing it. If none of the options above helped you, you might need to investigate deeper by enabling an error display that allows you to find and locate a specific issue on your site.

You can easily do so through the PHP Configuration section on your hosting control panel. Switch to the PHP Options and put a check on the display_errors and log_errors columns, then scroll down and Save. Once you refresh your site, it should display the specific.

Changing PHP options in hPanel.

Alternatively, you can also create a separate error log file and generate entries through the .htaccess file.

7. Using WordPress Debugging

If the step above didn’t work to fix the error in WordPress, it has its own special debugging system that you can use to troubleshoot issues. You can use it to generate an error log in the wp_content folder or to display the error 500 on your site when you access it. All you need to do is to enable the WordPress Debug feature.

8. Restoring a Backup of Your Site

In case you’ve backed up WordPress when it was functional, restoring the backup is also an option. All you need to do is remove all your recent site files and re-upload the backup to your site.

However, if you are not a fan of restoring WordPress backups manually, you can use a plugin. It won’t be much help if your site is not functional, but it can surely help avoid similar issues in the future.

To create and restore a backup through the All-in-One WP Migration plugin, follow these steps:

  1. Install and activate the plugin from the Plugin section.
  2. Then select the Backups tab.
  3. Choose Generate a new backup to export your files. Once the process is done, Download the exported files.
  4. To restore a backup, you will need to delete your current website and install a new WordPress site and the All-in-One WP Migration plugin.
  5. Then, select the Import feature and upload the backup stored on your computer and proceed with the restoration.
  6. That’s it. Keep in mind that if your site needs more than a 512MB import size, you can upgrade and get unlimited upload and backup sizes by purchasing the plugin’s premium plan for a one-time price of $69.

9. Re-uploading Core WordPress Files

If nothing seems to go right, there is a more extreme option to fix the 500 error. You will be replacing all of the core WordPress files. Here’s how:

  1. Download the latest version of WordPress and unzip it on your computer.
  2. Go to the unzipped files and delete the wp-config-sample.php file and the wp-content folder to avoid overwriting any important data.
  3. Configure FileZilla, move all the WordPress core files to your site’s location, and overwrite the existing ones.
  4. Once a confirmation screen pops out, check the Always use this action and Apply to current queue only columns. That way, you won’t need to confirm the overwriting process for each file.
  5. That’s it. You just have to wait for the process to finish.

Important! Make sure that you already have a backup of your current website in case anything goes wrong.

10. Contacting your Hosting Provider

If at the end of the day, all the methods haven’t been successful and you still can’t solve the issue of the 500 error, then it’s time for some more help. Contact your web hosting customer success team and get some backup.

They will be able to check the server logs and locate the root cause of your issue.

What Causes the 500 Internal Server Error?

The most common reasons behind the Internal Server Error are corrupted .htaccess files, a new theme and or plugin, incompatible PHP version, or a WordPress update.

One of the best things to do when troubleshooting this error is to trace back your steps. Try remembering what specific event caused your site to stop functioning. When you know exactly what went wrong, find the best solution from the list.

500 Internal Server Error Variations

Since there are different web servers, browsers, and operating systems, the HTTP 500 error can appear in many ways. Here are a few variations that you’ll see:

  • 500 Internal Server Error
  • HTTP 500
  • Error 500
  • HTTPS 500 error
  • Temporary Error (500)
  • HTTPS error 500
  • HTTP Error 500 – Internal Server Error
  • The website cannot display the page – HTTP 500

In addition to the list, you might see a blank white screen or a longer error message asking you to contact the server administrator.

It is becoming more common to have a custom 500 Internal Server Error page as well.

Conclusion

Most who use WordPress have encountered the HTTP error 500 WordPress problem. However, whether you’re an advanced developer, or a beginner, fixing the error is pretty easy if you know what to do.

Here’s a quick recap of the methods we’ve learned today:

  • Disabling a corrupted plugin through the WordPress Dashboard or File Manager.
  • Changing the WordPress theme to the default one through phpMyAdmin.
  • Increasing the memory limit and the PHP limit value via the .htaccess file.
  • Changing the PHP version to the latest one with the PHP Configurations tool on the hPanel.
  • Enabling the error display through the PHP Options.
  • Using the WordPress Debug.
  • Restoring a Backup of your site manually or with a migration plugin.
  • Re-uploading the Core WordPress files.

There you have it. The 500 Internal Server Error can be scary, but if you follow the steps we provided carefully, you’ll be able to fix the issue and access your site again in no time. Good luck!

Author

Domantas leads the content and SEO teams forward with fresh ideas and out of the box approaches. Armed with extensive SEO and marketing knowledge, he aims to spread the word of Hostinger to every corner of the world. During his free time, Domantas likes to hone his web development skills and travel to exotic places.

The dreaded 500 internal server error. It always seems to come at the most inopportune time and you’re suddenly left scrambling to figure out how to get your WordPress site back online. Trust us, we’ve all been there. Other errors that behave similarly that you might have also seen include the frightening error establishing a database connection and the dreaded white screen of death. But from the moment your site goes down, you’re losing visitors and customers. Not to mention it simply looks bad for your brand.

Today we’re going to dive into the 500 internal server error and walk you through some ways to get your site back online quickly. Read more below about what causes this error and what you can do to prevent it in the future.

  • What is a 500 internal server error?
  • How to fix the 500 internal server error

500 Internal Server Error (Most Common Causes):

500 Internal server error in WordPress can be caused by many things. If you’re experiencing one, there’s a high chance one (or more) of the following elements is causing the issue:

  • Browser Cache.
  • Incorrect database login credentials.
  • Corrupted database.
  • Corrupted files in your WordPress installation.
  • Issues with your database server.
  • Corrupted WordPress core files.
  • Corrupted .htaccess file and PHP memory limit.
  • Issues with third-party plugins and themes.
  • PHP timing out or fatal PHP errors with third-party plugins.
  • Wrong file and folder permissions.
  • Exhausted PHP memory limit on your server
  • Corrupted or broken .htaccess file.
  • Errors in CGI and Perl script.

Check Out Our Ultimate Guide to Fixing the 500 Internal Server Error

What is a 500 Internal Server Error?

The Internet Engineering Task Force (IETF) defines the 500 Internal Server Error as:

The 500 (Internal Server Error) status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.

When you visit a website your browser sends a request over to the server where the site is hosted. The server takes this request, processes it, and sends back the requested resources (PHP, HTML, CSS, etc.) along with an HTTP header. The HTTP also includes what they call an HTTP status code. A status code is a way to notify you about the status of the request. It could be a 200 status code which means “Everything is OK” or a 500 status code which means something has gone wrong.

There are a lot of different types of 500 status error codes (500, 501, 502, 503, 504, etc.) and they all mean something different. In this case, a 500 internal server error indicates that the server encountered an unexpected condition that prevented it from fulfilling the request (RFC 7231, section 6.6.1).

500 internal server error in WordPress

500 internal server error in WordPress

500 Internal Server Error Variations

Due to the various web servers, operating systems, and browsers, a 500 internal server error can present itself in a number of different ways. But they are all communicating the same thing. Below are just a couple of the many different variations you might see on the web:

    • “500 Internal Server Error”
    • “HTTP 500”
    • “Internal Server Error”
    • “HTTP 500 – Internal Server Error”
    • “500 Error”
    • “HTTP Error 500”
    • “500 – Internal Server Error”
    • “500 Internal Server Error. Sorry something went wrong.”
    • “500. That’s an error. There was an error. Please try again later. That’s all we know.”
    • “The website cannot display the page – HTTP 500.”
    • “Is currently unable to handle this request. HTTP ERROR 500.”

You might also see this message accompanying it:

The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log.

Internal Server Error

Internal Server Error

Other times, you might simply see a blank white screen. When dealing with 500 internal server errors, this is actually quite common in browsers like Firefox and Safari.

500 internal server error in Firefox

500 internal server error in Firefox

Bigger brands might even have their own custom 500 internal server error messages, such as this one from Airbnb.

Airbnb 500 internal server error

Airbnb 500 internal server error

Here is another creative 500 server error example from the folks over at readme.

readme 500 internal server error

readme 500 internal server error

Even the mighty YouTube isn’t safe from 500 internal server errors.

500 internal server error on YouTube

500 internal server error on YouTube

If it’s an IIS 7.0 (Windows) or higher server, they have additional HTTP status codes to more closely indicate the cause of the 500 error:

  • 500.0 – Module or ISAPI error occurred.
  • 500.11 – Application is shutting down on the web server.
  • 500.12 – Application is busy restarting on the web server.
  • 500.13 – Web server is too busy.
  • 500.15 – Direct requests for global.asax are not allowed.
  • 500.19 – Configuration data is invalid.
  • 500.21 – Module not recognized.
  • 500.22 – An ASP.NET httpModules configuration does not apply in Managed Pipeline mode.
  • 500.23 – An ASP.NET httpHandlers configuration does not apply in Managed Pipeline mode.
  • 500.24 – An ASP.NET impersonation configuration does not apply in Managed Pipeline mode.
  • 500.50 – A rewrite error occurred during RQ_BEGIN_REQUEST notification handling. A configuration or inbound rule execution error occurred.
  • 500.51 – A rewrite error occurred during GL_PRE_BEGIN_REQUEST notification handling. A global configuration or global rule execution error occurred.
  • 500.52 – A rewrite error occurred during RQ_SEND_RESPONSE notification handling. An outbound rule execution occurred.
  • 500.53 – A rewrite error occurred during RQ_RELEASE_REQUEST_STATE notification handling. An outbound rule execution error occurred. The rule is configured to be executed before the output user cache gets updated.
    500.100 – Internal ASP error.

500 Errors Impact on SEO

Unlike 503 errors, which are used for WordPress maintenance mode and tell Google to check back at a later time, a 500 error can have a negative impact on SEO if not fixed right away. If your site is only down for say 10 minutes and it’s being crawled consistently a lot of times the crawler will simply get the page delivered from cache. Or Google might not even have a chance to re-crawl it before it’s back up. In this scenario, you’re completely fine.

However, if the site is down for an extended period of time, say 6+ hours, then Google might see the 500 error as a site level issue that needs to be addressed. This could impact your rankings. If you’re worried about repeat 500 errors you should figure out why they are happening to begin with. Some of the solutions below can help.

How to Fix the 500 Internal Server Error

Where should you start troubleshooting when you see a 500 internal server error on your WordPress site? Sometimes you might not even know where to begin. Typically 500 errors are on the server itself, but from our experience, these errors originate from two things, the first is user error (client-side issue), and the second is that there is a problem with the server. So we’ll dive into a little of both.

This is never not annoying 😖 pic.twitter.com/pPKxbkvI9K

— Dare Obasanjo 🐀 (@Carnage4Life) September 26, 2019

Check out these common causes and ways to fix the 500 internal server error and get back up and running in no time.

1. Try Reloading the Page

This might seem a little obvious to some, but one of the easiest and first things you should try when encountering a 500 internal server error is to simply wait a minute or so and reload the page (F5 or Ctrl + F5). It could be that the host or server is simply overloaded and the site will come right back. While you’re waiting, you could also quickly try a different browser to rule that out as an issue.

Another thing you can do is to paste the website into downforeveryoneorjustme.com. This website will tell you if the site is down or if it’s a problem on your side. A tool like this checks the HTTP status code that is returned from the server. If it’s anything other than a 200 “Everything is OK” then it will return a down indication.

downforeveryoneorjustme

downforeveryoneorjustme

We’ve also noticed that sometimes this can occur immediately after you update a plugin or theme on your WordPress site. Typically this is on hosts that aren’t set up properly. What happens is they experience a temporary timeout right afterward. However, things usually resolve themselves in a couple of seconds and therefore refreshing is all you need to do.

2. Clear Your Browser Cache

Clearing your browser cache is always another good troubleshooting step before diving into deeper debugging on your site. Below are instructions on how to clear cache in the various browsers:

  • How to Force Refresh a Single Page for All Browsers
  • How to Clear Browser Cache for Google Chrome
  • How to Clear Browser Cache for Mozilla Firefox
  • How to Clear Browser Cache for Safari
  • How to Clear Browser Cache for Internet Explorer
  • How to Clear Browser Cache for Microsoft Edge
  • How to Clear Browser Cache for Opera

3. Check Your Server Logs

You should also take advantage of your error logs. If you’re a Kinsta client, you can easily see errors in the log viewer in the MyKinsta dashboard. This can help you quickly narrow down the issue, especially if it’s resulting from a plugin on your site.

Check error logs for 500 internal server errors

Check error logs for 500 internal server errors

If your host doesn’t have a logging tool, you can also enable WordPress debugging mode by adding the following code to your wp-config.php file to enable logging:

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

The logs are typically located in the /wp-content directory. Others, like here at Kinsta might have a dedicated folder called “logs”.

WordPress error logs folder (SFTP)

WordPress error logs folder (SFTP)

You can also check the log files in Apache and Nginx, which are commonly located here:

  • Apache: /var/log/apache2/error.log
  • Nginx: /var/log/nginx/error.log

If you’re a Kinsta client you can also take advantage of our analytics tool to get a breakdown of the total number of 500 errors and see how often and when they are occurring. This can help you troubleshoot if this is an ongoing issue, or perhaps something that has resolved itself.

Response analysis 500 error breakdown

Response analysis 500 error breakdown

If the 500 error is displaying because of a fatal PHP error, you can also try enabling PHP error reporting. Simply add the following code to the file throwing the error. Typically you can narrow down the file in the console tab of Google Chrome DevTools.

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

And you might need to also modify your php.ini file with the following:

display_errors = on

4. Error Establishing a Database Connection

500 internal server errors can also occur from a database connection error. Depending upon your browser you might see different errors. But both will generate a 500 HTTP status code regardless in your server logs.

Below is an example of what an “error establishing a database connection” message looks like your browser. The entire page is blank because no data can be retrieved to render the page, as the connection is not working properly. Not only does this break the front-end of your site, but it will also prevent you from accessing your WordPress dashboard.

Example of error establishing a database connection

Example of error establishing a database connection

So why exactly does this happen? Well, here are a few common reasons below.

  • The most common issue is that your database login credentials are incorrect. Your WordPress site uses separate login information to connect to its MySQL database.
  • Your WordPress database is corrupted. With so many moving parts with themes, plugins, and users constantly deleting and installing them, sometimes databases get corrupted. This can be due to a missing or individually corrupted table, or perhaps some information was deleted by accident.
  • You may have corrupt files in your WordPress installation. This can even happen sometimes due to hackers.
  • Issues with your database server. A number of things could be wrong on the web hosts end, such as the database being overloaded from a traffic spike or unresponsive from too many concurrent connections. This is actually quite common with shared hosts as they are utilizing the same resources for a lot of users on the same servers.

Check out our in-depth post on how to fix the error establishing a database connection in WordPress.

5. Check Your Plugins and Themes

Third-party plugins and themes can easily cause 500 internal server errors. We’ve seen all types cause them here at Kinsta, from slider plugins to ad rotator plugins. A lot of times you should see the error immediately after installing something new or running an update. This is one reason why we always recommend utilizing a staging environment for updates or at least running updates one by one. Otherwise, if you encounter a 500 internal server error you’re suddenly scrambling to figure out which one caused it.

A few ways you can troubleshoot this is by deactivating all your plugins. Remember, you won’t lose any data if you simply deactivate a plugin. If you can still access your admin, a quick way to do this is to browse to “Plugins” and select “Deactivate” from the bulk actions menu. This will disable all of your plugins.

Deactivate all plugins

Deactivate all plugins

If this fixes the issue you’ll need to find the culprit. Start activating them one by one, reloading the site after each activation. When you see the 500 internal server error return, you’ve found the misbehaving plugin. You can then reach out to the plugin developer for help or post a support ticket in the WordPress repository.

If you can’t login to WordPress admin you can FTP into your server and rename your plugins folder to something like plugins_old. Then check your site again. If it works, then you will need to test each plugin one by one. Rename your plugin folder back to “plugins” and then rename each plugin folder inside of if it, one by one, until you find it. You could also try to replicate this on a staging site first.

Rename plugin folder

Rename plugin folder

Always makes sure your plugins, themes, and WordPress core are up to date. And check to ensure you are running a supported version of PHP. If it turns out to be a conflict with bad code in a plugin, you might need to bring in a WordPress developer to fix the issue.

6. Reinstall WordPress Core

Sometimes WordPress core files can get corrupted, especially on older sites. It’s actually quite easy to re-upload just the core of WordPress without impacting your plugins or themes. We have an in-depth guide with 5 different ways to reinstall WordPress. And of course, make sure to take a backup before proceeding. Skip to one of the sections below:

  • How to reinstall WordPress from the WordPress dashboard while preserving existing content
  • How to manually reinstall WordPress via FTP while preserving existing content
  • How to manually reinstall WordPress via WP-CLI while preserving existing content

7. Permissions Error

A permissions error with a file or folder on your server can also cause a 500 internal server error to occur. Here are some typical recommendations for permissions when it comes to file and folder permissions in WordPress:

  • All files should be 644 (-rw-r–r–) or 640.
  • All directories should be 755 (drwxr-xr-x) or 750.
  • No directories should ever be given 777, even upload directories.
  • Hardening: wp-config.php could also be set to 440 or 400 to prevent other users on the server from reading it.

See the WordPress Codex article on changing file permissions for a more in-depth explanation.

You can easily see your file permissions with an FTP client (as seen below). You could also reach out to your WordPress host support team and ask them to quickly GREP file permissions on your folders and files to ensure they’re setup properly.

File permissions SFTP

File permissions SFTP

8. PHP Memory Limit

A 500 internal server error could also be caused by exhausting the PHP memory limit on your server. You could try increasing the limit. Follow the instructions below on how to change this limit in cPanel, Apache, your php.ini file, and wp-config.php file.

Increase PHP Memory Limit in cPanel

If you’re running on a host that uses cPanel, you can easily change this from the UI. Under Software click on “Select PHP Version.”

Select PHP version

Select PHP version

Click on “Switch to PHP Options.”

Switch to PHP options

Switch to PHP options

You can then click on the memory_limit attribute and change its value. Then click on “Save.”

Increase PHP memory limit in cPanel

Increase PHP memory limit in cPanel

Increase PHP Memory Limit in Apache

The .htaccess file is a special hidden file that contains various settings you can use to modify the server behavior, right down to a directory specific level. First login to your site via FTP or SSH, take a look at your root directory and see if there is a .htaccess file there.

.htaccess file

.htaccess file

If there is you can edit that file to add the necessary code for increasing the PHP memory limit. Most likely it is set at 64M or below, you can try increasing this value.

php_value memory_limit 128M

Increase PHP Memory Limit in php.ini File

If the above doesn’t work for you might try editing your php.ini file. Log in to your site via FTP or SSH, go to your site’s root directory and open or create a php.ini file.

php.ini file

php.ini file

If the file was already there, search for the three settings and modify them if necessary. If you just created the file, or the settings are nowhere to be found you can paste the code below. You can modify of course the values to meet your needs.

memory_limit = 128M

Some shared hosts might also require that you add the suPHP directive in your .htaccess file for the above php.ini file settings to work. To do this, edit your .htaccess file, also located at the root of your site, and add the following code towards the top of the file:

<IfModule mod_suphp.c> 
suPHP_ConfigPath /home/yourusername/public_html
</IfModule>

If the above didn’t work for you, it could be that your host has the global settings locked down and instead have it configured to utilize .user.ini files. To edit your .user.ini file, login to your site via FTP or SSH, go to your site’s root directory and open or create a .user.ini file. You can then paste in the following code:

memory_limit = 128M

Increase PHP Memory Limit in wp-config.php

The last option is not one we are fans of, but if all else fails you can give it a go. First, log in to your site via FTP or SSH, and locate your wp-config.php file, which is typically in the root of your site.

wp-config.php file

wp-config.php file

Add the following code to the top of your wp-config.php file:

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

You can also ask your host if you’re running into memory limit issues. We utilize the Kinsta APM tool and other troubleshooting methods here at Kinsta to help clients narrow down what plugin, query, or script might be exhausting the limit. You can also use your own custom New Relic key from your own license.

Debugging with New Relic

Debugging with New Relic

9. Problem With Your .htaccess File

Kinsta only uses Nginx, but if you’re using a WordPress host that is running Apache, it could very well be that your .htaccess file has a problem or has become corrupted. Follow the steps below to recreate a new one from scratch.

First, log in to your site via FTP or SSH, and rename your .htaccess file to .htaccess_old.

Rename .htaccess file

Rename .htaccess file

Normally to recreate this file you can simply re-save your permalinks in WordPress. However, if you’re in the middle of a 500 internal server error you most likely can’t access your WordPress admin, so this isn’t an option. Therefore you can create a new .htaccess file and input the following contents. Then upload it to your server.

# 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

See the WordPress Codex for more examples, such as a default .htaccess file for multisite.

10. Coding or Syntax Errors in Your CGI/Perl Script

500 errors being caused by errors in CGI and Perl is a lot less common than it used to be. Although it’s still worth mentioning, especially for those using cPanel where there are a lot of one-click CGI scripts still being used. As AEM on Stack Overflow says:

CGI has been replaced by a vast variety of web programming technologies, including PHP, various Apache extensions like mod_perl, Java of various flavors and frameworks including Java EE, Struts, Spring, etc, Python-based frameworks like Django, Ruby on Rails and many other Ruby frameworks, and various Microsoft technologies.

Here are a few tips when working with CGI scripts:

  • When editing, always used a plain text editor, such as Atom, Sublime, or Notepad++. This ensures they remain in ASCII format.
  • Ensure correct permissions of chmod 755 are used on CGI scripts and directories.
  • Upload your CGI scripts in ASCII mode (which you can select in your FTP editor) into the cgi-bin directory on your server.
  • Confirm that the Perl modules you require for your script are installed and supported.

11. Server Issue (Check With Your Host)

Finally, because 500 internal server errors can also occur from PHP timing out or fatal PHP errors with third-party plugins, you can always check with your WordPress host. Sometimes these errors can be difficult to troubleshoot without an expert. Here are just a few common examples of some errors that trigger 500 HTTP status codes on the server that might have you scratching your head.

PHP message: PHP Fatal error: Uncaught Error: Call to undefined function mysql_error()...
PHP message: PHP Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in /www/folder/web/shared/content/plugins/plugin/functions.php:525

We monitor all client’s sites here at Kinsta and are automatically notified when these types of errors occur. This allows us to be pro-active and start fixing the issue right away. We also utilize LXD managed hosts and orchestrated LXC software containers for each site. This means that every WordPress site is housed in its own isolated container, which has all of the software resources required to run it (Linux, Nginx, PHP, MySQL). The resources are 100% private and are not shared with anyone else or even your own sites.

PHP timeouts could also occur from the lack of PHP workers, although typically these cause 504 errors, not 500 errors. These determine how many simultaneous requests your site can handle at a given time. To put it simply, each uncached request for your website is handled by a PHP Worker.

When PHP workers are already busy on a site, they start to build up a queue. Once you’ve reached your limit of PHP workers, the queue starts to push out older requests which could result in 500 errors or incomplete requests. Read our in-depth article about PHP workers.

Monitor Your Site

If you’re worried about these types of errors happening on your site in the future, you can also utilize a tool like updown.io to monitor and notify you immediately if they occur. It periodically sends an HTTP HEAD request to the URL of your choice. You can simply use your homepage. The tool allows you to set check frequencies of:

  • 15 seconds
  • 30 seconds
  • 1 minute
  • 2 minutes
  • 5 minutes
  • 10 minutes

It will send you an email if and when your site goes down. Here is an example below.

Email notification of 500 error

Email notification of 500 error

This can be especially useful if you’re trying to debug a faulty plugin or are on a shared host, who tend to overcrowd their servers. This can give you proof of how often your site might actually be doing down (even during the middle of the night).

That’s why we always recommend going with an application, database, and managed WordPress host (like Kinsta).

Make sure to check out our post that explores the top 9 reasons to choose managed WordPress hosting.

Summary

500 internal server errors are always frustrating, but hopefully, now you know a few additional ways to troubleshoot them to quickly get your site back up and running. Remember, typically these types of errors are caused by third-party plugins, fatal PHP errors, database connection issues, problems with your .htaccess file or PHP memory limits, and sometimes PHP timeouts.

Was there anything we missed? Perhaps you have another tip on troubleshooting 500 internal server errors. If so, let us know below in the comments.


Get all your applications, databases and WordPress sites online and under one roof. Our feature-packed, high-performance cloud platform includes:

  • Easy setup and management in the MyKinsta dashboard
  • 24/7 expert support
  • The best Google Cloud Platform hardware and network, powered by Kubernetes for maximum scalability
  • An enterprise-level Cloudflare integration for speed and security
  • Global audience reach with up to 35 data centers and 275+ PoPs worldwide

Test it yourself with $20 off your first month of Application Hosting or Database Hosting. Explore our plans or talk to sales to find your best fit.

The dreaded 500 internal server error. It always seems to come at the most inopportune time and you’re suddenly left scrambling to figure out how to get your WordPress site back online. Trust us, we’ve all been there. Other errors that behave similarly that you might have also seen include the frightening error establishing a database connection and the dreaded white screen of death. But from the moment your site goes down, you’re losing visitors and customers. Not to mention it simply looks bad for your brand.

Today we’re going to dive into the 500 internal server error and walk you through some ways to get your site back online quickly. Read more below about what causes this error and what you can do to prevent it in the future.

  • What is a 500 internal server error?
  • How to fix the 500 internal server error

500 Internal Server Error (Most Common Causes):

500 Internal server error in WordPress can be caused by many things. If you’re experiencing one, there’s a high chance one (or more) of the following elements is causing the issue:

  • Browser Cache.
  • Incorrect database login credentials.
  • Corrupted database.
  • Corrupted files in your WordPress installation.
  • Issues with your database server.
  • Corrupted WordPress core files.
  • Corrupted .htaccess file and PHP memory limit.
  • Issues with third-party plugins and themes.
  • PHP timing out or fatal PHP errors with third-party plugins.
  • Wrong file and folder permissions.
  • Exhausted PHP memory limit on your server
  • Corrupted or broken .htaccess file.
  • Errors in CGI and Perl script.

Check Out Our Ultimate Guide to Fixing the 500 Internal Server Error

What is a 500 Internal Server Error?

The Internet Engineering Task Force (IETF) defines the 500 Internal Server Error as:

The 500 (Internal Server Error) status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.

When you visit a website your browser sends a request over to the server where the site is hosted. The server takes this request, processes it, and sends back the requested resources (PHP, HTML, CSS, etc.) along with an HTTP header. The HTTP also includes what they call an HTTP status code. A status code is a way to notify you about the status of the request. It could be a 200 status code which means “Everything is OK” or a 500 status code which means something has gone wrong.

There are a lot of different types of 500 status error codes (500, 501, 502, 503, 504, etc.) and they all mean something different. In this case, a 500 internal server error indicates that the server encountered an unexpected condition that prevented it from fulfilling the request (RFC 7231, section 6.6.1).

500 internal server error in WordPress

500 internal server error in WordPress

500 Internal Server Error Variations

Due to the various web servers, operating systems, and browsers, a 500 internal server error can present itself in a number of different ways. But they are all communicating the same thing. Below are just a couple of the many different variations you might see on the web:

    • “500 Internal Server Error”
    • “HTTP 500”
    • “Internal Server Error”
    • “HTTP 500 – Internal Server Error”
    • “500 Error”
    • “HTTP Error 500”
    • “500 – Internal Server Error”
    • “500 Internal Server Error. Sorry something went wrong.”
    • “500. That’s an error. There was an error. Please try again later. That’s all we know.”
    • “The website cannot display the page – HTTP 500.”
    • “Is currently unable to handle this request. HTTP ERROR 500.”

You might also see this message accompanying it:

The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log.

Internal Server Error

Internal Server Error

Other times, you might simply see a blank white screen. When dealing with 500 internal server errors, this is actually quite common in browsers like Firefox and Safari.

500 internal server error in Firefox

500 internal server error in Firefox

Bigger brands might even have their own custom 500 internal server error messages, such as this one from Airbnb.

Airbnb 500 internal server error

Airbnb 500 internal server error

Here is another creative 500 server error example from the folks over at readme.

readme 500 internal server error

readme 500 internal server error

Even the mighty YouTube isn’t safe from 500 internal server errors.

500 internal server error on YouTube

500 internal server error on YouTube

If it’s an IIS 7.0 (Windows) or higher server, they have additional HTTP status codes to more closely indicate the cause of the 500 error:

  • 500.0 – Module or ISAPI error occurred.
  • 500.11 – Application is shutting down on the web server.
  • 500.12 – Application is busy restarting on the web server.
  • 500.13 – Web server is too busy.
  • 500.15 – Direct requests for global.asax are not allowed.
  • 500.19 – Configuration data is invalid.
  • 500.21 – Module not recognized.
  • 500.22 – An ASP.NET httpModules configuration does not apply in Managed Pipeline mode.
  • 500.23 – An ASP.NET httpHandlers configuration does not apply in Managed Pipeline mode.
  • 500.24 – An ASP.NET impersonation configuration does not apply in Managed Pipeline mode.
  • 500.50 – A rewrite error occurred during RQ_BEGIN_REQUEST notification handling. A configuration or inbound rule execution error occurred.
  • 500.51 – A rewrite error occurred during GL_PRE_BEGIN_REQUEST notification handling. A global configuration or global rule execution error occurred.
  • 500.52 – A rewrite error occurred during RQ_SEND_RESPONSE notification handling. An outbound rule execution occurred.
  • 500.53 – A rewrite error occurred during RQ_RELEASE_REQUEST_STATE notification handling. An outbound rule execution error occurred. The rule is configured to be executed before the output user cache gets updated.
    500.100 – Internal ASP error.

500 Errors Impact on SEO

Unlike 503 errors, which are used for WordPress maintenance mode and tell Google to check back at a later time, a 500 error can have a negative impact on SEO if not fixed right away. If your site is only down for say 10 minutes and it’s being crawled consistently a lot of times the crawler will simply get the page delivered from cache. Or Google might not even have a chance to re-crawl it before it’s back up. In this scenario, you’re completely fine.

However, if the site is down for an extended period of time, say 6+ hours, then Google might see the 500 error as a site level issue that needs to be addressed. This could impact your rankings. If you’re worried about repeat 500 errors you should figure out why they are happening to begin with. Some of the solutions below can help.

How to Fix the 500 Internal Server Error

Where should you start troubleshooting when you see a 500 internal server error on your WordPress site? Sometimes you might not even know where to begin. Typically 500 errors are on the server itself, but from our experience, these errors originate from two things, the first is user error (client-side issue), and the second is that there is a problem with the server. So we’ll dive into a little of both.

This is never not annoying 😖 pic.twitter.com/pPKxbkvI9K

— Dare Obasanjo 🐀 (@Carnage4Life) September 26, 2019

Check out these common causes and ways to fix the 500 internal server error and get back up and running in no time.

1. Try Reloading the Page

This might seem a little obvious to some, but one of the easiest and first things you should try when encountering a 500 internal server error is to simply wait a minute or so and reload the page (F5 or Ctrl + F5). It could be that the host or server is simply overloaded and the site will come right back. While you’re waiting, you could also quickly try a different browser to rule that out as an issue.

Another thing you can do is to paste the website into downforeveryoneorjustme.com. This website will tell you if the site is down or if it’s a problem on your side. A tool like this checks the HTTP status code that is returned from the server. If it’s anything other than a 200 “Everything is OK” then it will return a down indication.

downforeveryoneorjustme

downforeveryoneorjustme

We’ve also noticed that sometimes this can occur immediately after you update a plugin or theme on your WordPress site. Typically this is on hosts that aren’t set up properly. What happens is they experience a temporary timeout right afterward. However, things usually resolve themselves in a couple of seconds and therefore refreshing is all you need to do.

2. Clear Your Browser Cache

Clearing your browser cache is always another good troubleshooting step before diving into deeper debugging on your site. Below are instructions on how to clear cache in the various browsers:

  • How to Force Refresh a Single Page for All Browsers
  • How to Clear Browser Cache for Google Chrome
  • How to Clear Browser Cache for Mozilla Firefox
  • How to Clear Browser Cache for Safari
  • How to Clear Browser Cache for Internet Explorer
  • How to Clear Browser Cache for Microsoft Edge
  • How to Clear Browser Cache for Opera

3. Check Your Server Logs

You should also take advantage of your error logs. If you’re a Kinsta client, you can easily see errors in the log viewer in the MyKinsta dashboard. This can help you quickly narrow down the issue, especially if it’s resulting from a plugin on your site.

Check error logs for 500 internal server errors

Check error logs for 500 internal server errors

If your host doesn’t have a logging tool, you can also enable WordPress debugging mode by adding the following code to your wp-config.php file to enable logging:

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

The logs are typically located in the /wp-content directory. Others, like here at Kinsta might have a dedicated folder called “logs”.

WordPress error logs folder (SFTP)

WordPress error logs folder (SFTP)

You can also check the log files in Apache and Nginx, which are commonly located here:

  • Apache: /var/log/apache2/error.log
  • Nginx: /var/log/nginx/error.log

If you’re a Kinsta client you can also take advantage of our analytics tool to get a breakdown of the total number of 500 errors and see how often and when they are occurring. This can help you troubleshoot if this is an ongoing issue, or perhaps something that has resolved itself.

Response analysis 500 error breakdown

Response analysis 500 error breakdown

If the 500 error is displaying because of a fatal PHP error, you can also try enabling PHP error reporting. Simply add the following code to the file throwing the error. Typically you can narrow down the file in the console tab of Google Chrome DevTools.

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

And you might need to also modify your php.ini file with the following:

display_errors = on

4. Error Establishing a Database Connection

500 internal server errors can also occur from a database connection error. Depending upon your browser you might see different errors. But both will generate a 500 HTTP status code regardless in your server logs.

Below is an example of what an “error establishing a database connection” message looks like your browser. The entire page is blank because no data can be retrieved to render the page, as the connection is not working properly. Not only does this break the front-end of your site, but it will also prevent you from accessing your WordPress dashboard.

Example of error establishing a database connection

Example of error establishing a database connection

So why exactly does this happen? Well, here are a few common reasons below.

  • The most common issue is that your database login credentials are incorrect. Your WordPress site uses separate login information to connect to its MySQL database.
  • Your WordPress database is corrupted. With so many moving parts with themes, plugins, and users constantly deleting and installing them, sometimes databases get corrupted. This can be due to a missing or individually corrupted table, or perhaps some information was deleted by accident.
  • You may have corrupt files in your WordPress installation. This can even happen sometimes due to hackers.
  • Issues with your database server. A number of things could be wrong on the web hosts end, such as the database being overloaded from a traffic spike or unresponsive from too many concurrent connections. This is actually quite common with shared hosts as they are utilizing the same resources for a lot of users on the same servers.

Check out our in-depth post on how to fix the error establishing a database connection in WordPress.

5. Check Your Plugins and Themes

Third-party plugins and themes can easily cause 500 internal server errors. We’ve seen all types cause them here at Kinsta, from slider plugins to ad rotator plugins. A lot of times you should see the error immediately after installing something new or running an update. This is one reason why we always recommend utilizing a staging environment for updates or at least running updates one by one. Otherwise, if you encounter a 500 internal server error you’re suddenly scrambling to figure out which one caused it.

A few ways you can troubleshoot this is by deactivating all your plugins. Remember, you won’t lose any data if you simply deactivate a plugin. If you can still access your admin, a quick way to do this is to browse to “Plugins” and select “Deactivate” from the bulk actions menu. This will disable all of your plugins.

Deactivate all plugins

Deactivate all plugins

If this fixes the issue you’ll need to find the culprit. Start activating them one by one, reloading the site after each activation. When you see the 500 internal server error return, you’ve found the misbehaving plugin. You can then reach out to the plugin developer for help or post a support ticket in the WordPress repository.

If you can’t login to WordPress admin you can FTP into your server and rename your plugins folder to something like plugins_old. Then check your site again. If it works, then you will need to test each plugin one by one. Rename your plugin folder back to “plugins” and then rename each plugin folder inside of if it, one by one, until you find it. You could also try to replicate this on a staging site first.

Rename plugin folder

Rename plugin folder

Always makes sure your plugins, themes, and WordPress core are up to date. And check to ensure you are running a supported version of PHP. If it turns out to be a conflict with bad code in a plugin, you might need to bring in a WordPress developer to fix the issue.

6. Reinstall WordPress Core

Sometimes WordPress core files can get corrupted, especially on older sites. It’s actually quite easy to re-upload just the core of WordPress without impacting your plugins or themes. We have an in-depth guide with 5 different ways to reinstall WordPress. And of course, make sure to take a backup before proceeding. Skip to one of the sections below:

  • How to reinstall WordPress from the WordPress dashboard while preserving existing content
  • How to manually reinstall WordPress via FTP while preserving existing content
  • How to manually reinstall WordPress via WP-CLI while preserving existing content

7. Permissions Error

A permissions error with a file or folder on your server can also cause a 500 internal server error to occur. Here are some typical recommendations for permissions when it comes to file and folder permissions in WordPress:

  • All files should be 644 (-rw-r–r–) or 640.
  • All directories should be 755 (drwxr-xr-x) or 750.
  • No directories should ever be given 777, even upload directories.
  • Hardening: wp-config.php could also be set to 440 or 400 to prevent other users on the server from reading it.

See the WordPress Codex article on changing file permissions for a more in-depth explanation.

You can easily see your file permissions with an FTP client (as seen below). You could also reach out to your WordPress host support team and ask them to quickly GREP file permissions on your folders and files to ensure they’re setup properly.

File permissions SFTP

File permissions SFTP

8. PHP Memory Limit

A 500 internal server error could also be caused by exhausting the PHP memory limit on your server. You could try increasing the limit. Follow the instructions below on how to change this limit in cPanel, Apache, your php.ini file, and wp-config.php file.

Increase PHP Memory Limit in cPanel

If you’re running on a host that uses cPanel, you can easily change this from the UI. Under Software click on “Select PHP Version.”

Select PHP version

Select PHP version

Click on “Switch to PHP Options.”

Switch to PHP options

Switch to PHP options

You can then click on the memory_limit attribute and change its value. Then click on “Save.”

Increase PHP memory limit in cPanel

Increase PHP memory limit in cPanel

Increase PHP Memory Limit in Apache

The .htaccess file is a special hidden file that contains various settings you can use to modify the server behavior, right down to a directory specific level. First login to your site via FTP or SSH, take a look at your root directory and see if there is a .htaccess file there.

.htaccess file

.htaccess file

If there is you can edit that file to add the necessary code for increasing the PHP memory limit. Most likely it is set at 64M or below, you can try increasing this value.

php_value memory_limit 128M

Increase PHP Memory Limit in php.ini File

If the above doesn’t work for you might try editing your php.ini file. Log in to your site via FTP or SSH, go to your site’s root directory and open or create a php.ini file.

php.ini file

php.ini file

If the file was already there, search for the three settings and modify them if necessary. If you just created the file, or the settings are nowhere to be found you can paste the code below. You can modify of course the values to meet your needs.

memory_limit = 128M

Some shared hosts might also require that you add the suPHP directive in your .htaccess file for the above php.ini file settings to work. To do this, edit your .htaccess file, also located at the root of your site, and add the following code towards the top of the file:

<IfModule mod_suphp.c> 
suPHP_ConfigPath /home/yourusername/public_html
</IfModule>

If the above didn’t work for you, it could be that your host has the global settings locked down and instead have it configured to utilize .user.ini files. To edit your .user.ini file, login to your site via FTP or SSH, go to your site’s root directory and open or create a .user.ini file. You can then paste in the following code:

memory_limit = 128M

Increase PHP Memory Limit in wp-config.php

The last option is not one we are fans of, but if all else fails you can give it a go. First, log in to your site via FTP or SSH, and locate your wp-config.php file, which is typically in the root of your site.

wp-config.php file

wp-config.php file

Add the following code to the top of your wp-config.php file:

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

You can also ask your host if you’re running into memory limit issues. We utilize the Kinsta APM tool and other troubleshooting methods here at Kinsta to help clients narrow down what plugin, query, or script might be exhausting the limit. You can also use your own custom New Relic key from your own license.

Debugging with New Relic

Debugging with New Relic

9. Problem With Your .htaccess File

Kinsta only uses Nginx, but if you’re using a WordPress host that is running Apache, it could very well be that your .htaccess file has a problem or has become corrupted. Follow the steps below to recreate a new one from scratch.

First, log in to your site via FTP or SSH, and rename your .htaccess file to .htaccess_old.

Rename .htaccess file

Rename .htaccess file

Normally to recreate this file you can simply re-save your permalinks in WordPress. However, if you’re in the middle of a 500 internal server error you most likely can’t access your WordPress admin, so this isn’t an option. Therefore you can create a new .htaccess file and input the following contents. Then upload it to your server.

# 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

See the WordPress Codex for more examples, such as a default .htaccess file for multisite.

10. Coding or Syntax Errors in Your CGI/Perl Script

500 errors being caused by errors in CGI and Perl is a lot less common than it used to be. Although it’s still worth mentioning, especially for those using cPanel where there are a lot of one-click CGI scripts still being used. As AEM on Stack Overflow says:

CGI has been replaced by a vast variety of web programming technologies, including PHP, various Apache extensions like mod_perl, Java of various flavors and frameworks including Java EE, Struts, Spring, etc, Python-based frameworks like Django, Ruby on Rails and many other Ruby frameworks, and various Microsoft technologies.

Here are a few tips when working with CGI scripts:

  • When editing, always used a plain text editor, such as Atom, Sublime, or Notepad++. This ensures they remain in ASCII format.
  • Ensure correct permissions of chmod 755 are used on CGI scripts and directories.
  • Upload your CGI scripts in ASCII mode (which you can select in your FTP editor) into the cgi-bin directory on your server.
  • Confirm that the Perl modules you require for your script are installed and supported.

11. Server Issue (Check With Your Host)

Finally, because 500 internal server errors can also occur from PHP timing out or fatal PHP errors with third-party plugins, you can always check with your WordPress host. Sometimes these errors can be difficult to troubleshoot without an expert. Here are just a few common examples of some errors that trigger 500 HTTP status codes on the server that might have you scratching your head.

PHP message: PHP Fatal error: Uncaught Error: Call to undefined function mysql_error()...
PHP message: PHP Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in /www/folder/web/shared/content/plugins/plugin/functions.php:525

We monitor all client’s sites here at Kinsta and are automatically notified when these types of errors occur. This allows us to be pro-active and start fixing the issue right away. We also utilize LXD managed hosts and orchestrated LXC software containers for each site. This means that every WordPress site is housed in its own isolated container, which has all of the software resources required to run it (Linux, Nginx, PHP, MySQL). The resources are 100% private and are not shared with anyone else or even your own sites.

PHP timeouts could also occur from the lack of PHP workers, although typically these cause 504 errors, not 500 errors. These determine how many simultaneous requests your site can handle at a given time. To put it simply, each uncached request for your website is handled by a PHP Worker.

When PHP workers are already busy on a site, they start to build up a queue. Once you’ve reached your limit of PHP workers, the queue starts to push out older requests which could result in 500 errors or incomplete requests. Read our in-depth article about PHP workers.

Monitor Your Site

If you’re worried about these types of errors happening on your site in the future, you can also utilize a tool like updown.io to monitor and notify you immediately if they occur. It periodically sends an HTTP HEAD request to the URL of your choice. You can simply use your homepage. The tool allows you to set check frequencies of:

  • 15 seconds
  • 30 seconds
  • 1 minute
  • 2 minutes
  • 5 minutes
  • 10 minutes

It will send you an email if and when your site goes down. Here is an example below.

Email notification of 500 error

Email notification of 500 error

This can be especially useful if you’re trying to debug a faulty plugin or are on a shared host, who tend to overcrowd their servers. This can give you proof of how often your site might actually be doing down (even during the middle of the night).

That’s why we always recommend going with an application, database, and managed WordPress host (like Kinsta).

Make sure to check out our post that explores the top 9 reasons to choose managed WordPress hosting.

Summary

500 internal server errors are always frustrating, but hopefully, now you know a few additional ways to troubleshoot them to quickly get your site back up and running. Remember, typically these types of errors are caused by third-party plugins, fatal PHP errors, database connection issues, problems with your .htaccess file or PHP memory limits, and sometimes PHP timeouts.

Was there anything we missed? Perhaps you have another tip on troubleshooting 500 internal server errors. If so, let us know below in the comments.


Get all your applications, databases and WordPress sites online and under one roof. Our feature-packed, high-performance cloud platform includes:

  • Easy setup and management in the MyKinsta dashboard
  • 24/7 expert support
  • The best Google Cloud Platform hardware and network, powered by Kubernetes for maximum scalability
  • An enterprise-level Cloudflare integration for speed and security
  • Global audience reach with up to 35 data centers and 275+ PoPs worldwide

Test it yourself with $20 off your first month of Application Hosting or Database Hosting. Explore our plans or talk to sales to find your best fit.

Viewing 10 replies — 1 through 10 (of 10 total)

  • where can i find prior versions of the plugin to go back?

    Hi @20something

    If It shows 500 error you should enable debug log usign define WP_DEBUG constant to true instead false in wp-config.php

    define( 'WP_DEBUG', true );
    

    and check for php error logs from erro_log file root of the wordpress install or some hosting cpanel providers php error logs list.

    If you let us know error we might can provide you solution.

    You can download the previous version AIOS 5.1.8 from the Plugin Avanced view https://wordpress.org/plugins/all-in-one-wp-security-and-firewall/advanced/

    https://snipboard.io/K6E3bX.jpg

    Or you can user WP Rollback plugin also it allows you to select previous version of plugin to rollback.

    Hi @20something

    There is no change in how wp-security-abstract-ids.php class added in AIOS 5.1.9 , So I will try check in more detail why the class being redeclared.

    can you please do one thing all-in-one-wp-security-and-firewall/wp-security-core.php

    Please remove that line 192 code and check. It it works ?

    include_once(AIO_WP_SECURITY_PATH.'/classes/wp-security-abstract-ids.php');

    Regards

    Hello,

    I just updated my version to 5.1.9 the same problem occurred.
    But as I use it on other sites, I compared the update with the other sites that were successful and I was able to find the problems.

    1 – The .htaccess it was adjusted, where the ips were blocked it ended up removing and changing location.

    2 – Inside the public_html or folder where your WP is located, you need to have the aios-bootstrap.php file, in my case after the update it disappeared, inside it there is a path to a file.

    3 – The .user.ini file needs to point to the aios-bootstrap.php item, my case was also deleted in the update, after adjusting these items, it was successful.

    Hope this helps.

    @hjogiupdraftplus

    I tried commenting out that line but still received the same error. I cleared the server caches and tried again and got the same error again.

    @wendool

    Thanks for the feedback. I tried the same steps but no joy in my case. I also have other sites on the hosting that updated properly but two of them have run into this error.

    @wendool

    Thanks for your input.

    Do you have the same issue “Cannot declare class AIOS_Abstracted_Ids” ? If I cross check aios-bootstrap.php removed here in my local not an issue So I will try replicate that issue.

    @abland

    Ok – commenting the line below which declares the class AIOS_Abstracted_Ids included in the classes/wp-security-helper.php alos on line 6, else no where it gets added with include and require so it seems strange issue also this has been introduced in AIOS 5.1.6

    include_once(AIO_WP_SECURITY_PATH.'/classes/wp-security-abstract-ids.php');

    require_once(__DIR__.'/wp-security-abstract-ids.php');

    Do it is the case that the site has been copied from somewhere else folder on the same hosting so it have two different path getting applied. Please cross check the aios-bootstrap.php have the wp-security-firewall.php file included is correct path ? and of not referring to another copy which includes wp-security-abstract-ids.php

    Regards

    Hello, @hjogiupdraftplus

    Thanks for the feedback. I managed to solve the problem by organizing the paths and files as in the versions that were successfully updated.

    So it was quick to adjust, it may have been a bug that occurred when updating, on other sites they were successful.

    Thanks for the feedback.

    Hi @wendool

    Ok – I will keep eye on this issue so some how I can replicate the issue.

    Regards

    Hi @hjogiupdraftplus

    You are correct that the sites were copies of an original site on the same hosting. I won’t be doing any further investigation though as the site owners are switching a lot of things up, but thanks for your help nonetheless.

    Hi @abland

    Ok, thanks for your input. I have created internal ticket for this already and looking for some how we may also reproduce issue.

    Regards

  • Viewing 10 replies — 1 through 10 (of 10 total)

    Понравилась статья? Поделить с друзьями:
  • Wordpress ошибка 404 на главной странице
  • Wordpress ошибка 403 доступ запрещен как исправить
  • Wordpress не отдает 404 ошибку
  • Wordpress на сайте возникла критическая ошибка при установке
  • Wordpress на все посты 404 ошибка