Вордпресс логи ошибок

WordPress логи - логирование ошибок и действий на сайте

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

Где хранится лог ошибок ВордПресс и как его посмотреть

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

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

Фактический журнал логов хранится в файле с именем debug.log в каталоге содержимого вашего сайта wp-content на сервере хостинг-провайдера. Как посмотреть логи? Один из способов просмотра и очистки журнала – прямой доступ к этому файлу. Скачайте файл с помощью файлового менеджера и откройте его любым текстовым редактором. Можно воспользоваться плагинами, которые упрощают работу с логами.

вордпресс логи

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

Как включить/выключить логирование

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

  1. Запустите файловый менеджер и подключитесь к удаленному серверу со своей учетной записью, который вам предоставил хостинг-провайдер.
  2. Перейдите в корневой каталог, где установлен ваш сайт.
  3. Сделайте резервную копию файла wp-config.php, чтобы восстановить систему после завершения отладки.

Откройте файл wp-config.php на удаленном сервере, вставьте или отредактируйте строки, которые управляют созданием логов:

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

Большинство сайтов на WordPress уже имеют запись для константы WP_DEBUG, установленную в значение false, поэтому вам нужно изменить это значение на true. Строка с WP_DEBUG_LOG может отсутствовать, поэтому придется ее добавить, эта команда активирует создание журнала логов для сайта. Константа WP_DEBUG_DISPLAY, установленная в значение false, поможет скрыть запись логов от посетителей сайта. Убедитесь, что каждая константа определена в файле только один раз.

вордпресс конфиг

Лог действий в WordPress

После того как запись логов включена, перейдите в папку содержимого сайта на WordPress. Обычно она называется wp-content, если вы не переименовали ее ранее. Откройте файл журнала debug.log, перейдите в конец и найдите строки с метками времени, соответствующими вашим недавним действиям над сайтом.

Каждый раз, когда возникает предупреждение или ошибка в работе сайта, WordPress генерирует уведомление, которое записывается в журнал логов с отметкой времени в формате UTC. По этим причинам на работающем сайте рекомендуется оставить WP_DEBUG включенным. Устраните выявленные проблемы, при необходимости восстановите оригинальный файл wp-config.php.

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

Плагины для логирования действий

Разработано несколько специальных плагинов, позволяющих просмотреть журнал логов напрямую из админки WordPress. Вы можете установить их прямо в админпанели в разделе «Плагины»

Activity Log – популярный плагин с большим количеством активных установок. Позволяет записать хронологию действий пользователей, их вход в админку и выход. Будут зафиксированы последние действия со страницами и записями, удаление и установка тем и плагинов.

WP Security Audit Log – плагин для мониторинга действий пользователей в админке сайта. Можно использовать для ведения лог-журнала электронного магазина WooCommerce и отслеживать изменение состояния продукта. Плагин создает предупреждение о безопасности, когда в системе создается новый пользователь, и позволяет отследить подозрительную активность, прежде чем это станет проблемой безопасности.

WP Log Viewer – плагин создает виджет панели администратора и позволяет включить/отключить запись лога одним щелчком мыши, при этом не требуется вручную редактировать файл wp-config.php. Можно выполнить фильтрацию ошибок, очистить журнал, сортировать записи по дате или провести поиск ошибок по времени. Пользовательские ошибки обозначаются разными цветами.

Error Log Monitor – этот плагин добавляет виджет, который видим только для администраторов. Он отображает последние сообщения из журнала логов, а также умеет отправлять уведомления по электронной почте о новых возникших ошибках. Частота уведомлений и количество отображаемых записей в журнале настраивается. Плагин оптимизирован для работы с очень большими лог-файлами.

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

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

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

No one likes to see errors on their website. Not only do they look bad to visitors and potential customers, but they also indicate that something’s wrong. But they’re, unfortunately, an inevitable part of running a site. The good news is that following a few best practices and being proactive can dramatically reduce the number of errors you experience. 

One way to monitor potential site issues — or troubleshoot existing ones — is to keep and review an error log. Let’s dive into this a bit more.

What is error logging and why is it important?

Error logging is the process of tracking and monitoring issues that occur on a website. This is usually done with a record of simple text files that live on your web server and are updated whenever an error occurs. Error logs are used to identify the number of problems that occur, provide details about each one, and show when it took place.

How to enable error logging

To enable error logging on your WordPress site, you’ll need sFTP access, available with WordPress.com plugin-enabled plans. This allows you to edit your website files remotely. In this case, you’ll be working with the wp-config.php file, which holds the basic configuration settings for your website.

A word of warning: you should only use sFTP and edit your wp-config.php file if you feel comfortable doing so. Mistakes can cause catastrophic errors on your website. If you don’t have experience changing these types of files, you may want to hire a developer or reach out to WordPress.com support for help.

1. Connect to your website via sFTP

You’ll need to start by enabling sFTP on your site. Go to My Site(s) → Settings → Hosting Configuration and click the Enable SFTP button.

Then, you’ll see your sFTP login details: URL, Port Number, Username, and Password. You’ll need to input these into FTP software, like FileZilla, to access your site. Follow these detailed instructions to connect to your WordPress.com website.

2. Find and download your wp-config.php file

Navigate to your wp-config.php file. This sits in the root directory of your file structure, alongside folders such as wp-content. Download this file, so you have a backup copy on hand.

3. Edit the wp-config.php file

Edit your wp-config.php file using a text editor such as Notepad.

Look for define( ‘WP_DEBUG’, false ); and replace this text with the following:

define( ‘WP_DEBUG’, true );

if ( WP_DEBUG ) {

        @error_reporting( E_ALL );

        @ini_set( ‘log_errors’, true );

        @ini_set( ‘log_errors_max_len’, ‘0’ );

        define( ‘WP_DEBUG_LOG’, true );

        define( ‘WP_DEBUG_DISPLAY’, false );

        define( ‘CONCATENATE_SCRIPTS’, false );

        define( ‘SAVEQUERIES’, true );

}

You’ve now successfully enabled error logging. You should only have this feature turned on while troubleshooting. Otherwise, it can leave your site more vulnerable to hacking attempts. To disable logging, simply delete the code you just added and restore the following:

define( ‘WP_DEBUG’, false );

How to view the error log manually

Once the log is enabled, you’ll need to load your website to trigger any error codes. Those codes are stored in a file called debug.log, which you can access via sFTP by following the same steps as above. 

You can find the debug.log file inside of the wp-content folder. If there are errors, the file will appear. However, if there aren’t any errors, then you won’t see it at all — congratulations!

Once you find the file, download it to your computer to view the full log, using a text editing software like Notepad. It will look something like this:

This file will provide valuable information that will point you, or your developer, to the source of your problem. 

How to view the error log using a plugin 

Using a plugin to find your error log can be an easier and faster method, depending on your level of experience. In the WordPress dashboard, click on Plugins → Add New. Search for “Error Log Monitor” and click Install → Activate.

This plugin installs a widget on your WordPress dashboard that allows you to access your error log. If you haven’t enabled error logging correctly, the widget will display instructions on how to do so. However, you should ignore these instructions, as they’re incorrect for a WordPress.com installation. Instead, use the ones listed above.

If you can’t see the dashboard widget, click on the Screen options tab at the top of the WordPress dashboard and ensure that “PHP error log” is checked.

How to find the plugin or theme that’s causing an error

Error logs are not inherently easy to read, but they do give insightful information into the cause of an error.

Typically, each line in your error log will display a message, alongside the date and time it happened and the file in which the error occurred. It also lists the line number where the error is located. For example:

Apr 20, 15:08:59

Notice: Undefined index: fg2 in /wordpress/themes/pub/varia/functions.php on line 166

Let’s break this down. First of all, there’s the date and time of the error: April 20, 15:08:59. This helps you determine if this was a one-off glitch or a recurring issue.

Then, you can see the type of error that’s been logged. Here are a few common types of error you may see here:

  • Notice. These are more warnings than errors, as they don’t actually stop your website code from executing. While you should still address a notice, your site will most likely still function, although potentially not as designed.
  • Parse error. This is typically the result of a mistake in the syntax of the underlying PHP code of the website (often in a theme or plugin). Parse errors include things like missing semicolons, parentheses, and other similar mistakes. A parse error will stop executing code when it hits the problem, so your site may look visibly broken or not function as intended.
  • Fatal error. This is often caused by undefined functions or classes, like a typo or poor coding practice. You can avoid it by using high-quality code, along with functions such as class_exists or function_exists.

In this case, the error is a notice.

Next, we see the error itself. In the example above the error is “undefined index.” This is followed by the specific location of the problem. In the above example, the error is occurring with the functions.php file of the Varia theme.

How to fix errors

Now that you can see your errors, it’s time to troubleshoot. Here’s a few things you can try:

  • If you’re a developer and the error is in your custom code, go to the line number in the log entry and work to debug.
  • If the error is within a theme or plugin, start by checking for any available updates. Keeping your plugins and themes up to date is critical for avoiding bugs and maintaining website security. Once you’ve applied any updates, re-check the error log to see if there are any new entries. If the error still exists, reach out to the plugin author or consider switching to an alternative. 
  • The error may also be caused by a conflict between two plugins. Try using the WordPress troubleshooting mode to fix this problem.
  • If the problem occurred immediately after installing or updating a plugin, deactivate it to see if the error persists. If it doesn’t, the plugin is the likely cause and you may want to find an alternative. If the error occured after a core update, you may need to manually deactivate plugins to find the source.

Troubleshooting with the WordPress error log

WordPress, like any software, may occasionally run into problems. It may seem confusing to find and fix those problems, but the error log can be a huge help! It enables you to learn valuable information that can help you troubleshoot and solve site errors in a timely manner.

To avoid errors, always use well-maintained plugins and themes, and keep on top of updates. Need more help? If you have a WordPress plugin-enabled plan, you benefit from world-class Happiness Engineers that can provide guidance.

Debugging PHP code is part of any project, but WordPress comes with specific debug systems designed to simplify the process as well as standardize code across the core, plugins and themes. This page describes the various debugging tools in WordPress and how to be more productive in your coding as well as increasing the overall quality and interoperativity of your code.

For non-programmers or general users, these options can be used to show detailed information about errors.

Example wp-config.php for Debugging

The following code, inserted in your wp-config.php file, will log all errors, notices, and warnings to a file called debug.log in the wp-content directory. It will also hide the errors so they do not interrupt page generation.

// 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 );

NOTE: You must insert this BEFORE /* That's all, stop editing! Happy blogging. */ in the wp-config.php file.

WP_DEBUG

WP_DEBUG is a PHP constant (a permanent global variable) that can be used to trigger the “debug” mode throughout WordPress. It is assumed to be false by default and is usually set to true in the wp-config.php file on development copies of WordPress.

// This enables debugging.
define( 'WP_DEBUG', true );
// This disables debugging.
define( 'WP_DEBUG', false );

Note: The true and false values in the example are not surrounded by apostrophes (‘) because they are boolean (true/false) values. If you set constants to 'false', they will be interpreted as true because the quotes make it a string rather than a boolean.

It is not recommended to use WP_DEBUG or the other debug tools on live sites; they are meant for local testing and staging installs.

PHP Errors, Warnings, and Notices

Enabling WP_DEBUG will cause all PHP errors, notices and warnings to be displayed. This is likely to modify the default behavior of PHP which only displays fatal errors and/or shows a white screen of death when errors are reached.

Showing all PHP notices and warnings often results in error messages for things that don’t seem broken, but do not follow proper data validation conventions inside PHP. These warnings are easy to fix once the relevant code has been identified, and the resulting code is almost always more bug-resistant and easier to maintain.

Deprecated Functions and Arguments

Enabling WP_DEBUG will also cause notices about deprecated functions and arguments within WordPress that are being used on your site. These are functions or function arguments that have not been removed from the core code yet but are slated for deletion in the near future. Deprecation notices often indicate the new function that should be used instead.

WP_DEBUG_LOG

WP_DEBUG_LOG is a companion to WP_DEBUG that causes all errors to also be saved to a debug.log log file This is useful if you want to review all notices later or need to view notices generated off-screen (e.g. during an AJAX request or wp-cron run).

Note that this allows you to write to log file using PHP’s built in error_log() function, which can be useful for instance when debugging Ajax events.

When set to true, the log is saved to debug.log in the content directory (usually wp-content/debug.log) within your site’s filesystem. Alternatively, you can set it to a valid file path to have the file saved elsewhere.

define( 'WP_DEBUG_LOG', true );
-or-
define( 'WP_DEBUG_LOG', '/tmp/wp-errors.log' );

Note: for WP_DEBUG_LOG to do anything, WP_DEBUG must be enabled (true). Remember you can turn off WP_DEBUG_DISPLAY independently.

WP_DEBUG_DISPLAY

WP_DEBUG_DISPLAY is another companion to WP_DEBUG that controls whether debug messages are shown inside the HTML of pages or not. The default is ‘true’ which shows errors and warnings as they are generated. Setting this to false will hide all errors. This should be used in conjunction with WP_DEBUG_LOG so that errors can be reviewed later.

define( 'WP_DEBUG_DISPLAY', false );

Note: for WP_DEBUG_DISPLAY to do anything, WP_DEBUG must be enabled (true). Remember you can control WP_DEBUG_LOG independently.

SCRIPT_DEBUG

SCRIPT_DEBUG is a related constant that will force WordPress to use the “dev” versions of core CSS and JavaScript files rather than the minified versions that are normally loaded. This is useful when you are testing modifications to any built-in .js or .css files. Default is false.

define( 'SCRIPT_DEBUG', true );

SAVEQUERIES

The SAVEQUERIES definition saves the database queries to an array and that array can be displayed to help analyze those queries. The constant defined as true causes each query to be saved, how long that query took to execute, and what function called it.

define( 'SAVEQUERIES', true );

The array is stored in the global $wpdb->queries.

NOTE: This will have a performance impact on your site, so make sure to turn this off when you aren’t debugging.

Debugging Plugins

There are many debugging plugins for WordPress that show more information about the internals, either for a specific component or in general. Here are some examples:

  • Query Monitor
  • Debug Bar
  • Log Deprecated Notices

External Resources

  • WordPress ‘wp-config.php’ file Generator
  • ‘No White Screen’ plugin: Display the error instead of a white screen

Do you need to access the WordPress error logs to troubleshoot a problem on your site?

WordPress comes with a debugging system that can log any error messages displayed on your site. This can help you discover and fix problems on your website.

In this article, we’ll show you how to find and access your WordPress error logs.

How to Find and Access WordPress Error Logs

How and When Can WordPress Error Logs Help?

Are you having problems with your WordPress website? Checking your WordPress error logs can help you find the source of the issues, such as slow website performance, plugins that aren’t working properly, and website crashes.

What Is an Error Log?

An error log is a list of error messages generated by your website and the dates and times they occurred. Once WordPress debug mode is turned on, these messages are collected in a file so that you can review them later.

Your WordPress error log is a troubleshooting tool that can help you identify plugins, themes, or code that are causing problems. You can then go ahead and find a fix for those WordPress errors.

For example, checking the error logs can help troubleshoot errors like the WordPress white screen of death, PHP errors, the invalid JSON error, and the “Sorry, you are not allowed to access this page” error.

That being said, let’s look at how to find and access your WordPress error logs. The first step is to enable WordPress debug mode, which you can do using either a plugin or code.

  • Enabling WordPress Debug Mode With a Plugin
  • Enabling WordPress Debug Mode Using Code
  • How to Find and Access WordPress Error Logs
  • How to Fix Issues Found in WordPress Error Logs
  • Disabling WordPress Debug Mode

Enabling WordPress Debug Mode With a Plugin

WordPress debugging is turned off by default, so WordPress will not be logging any errors. If you can still log in to your WordPress site, then you can enable debug mode using a plugin.

The first thing you need to do is install the WP Debugging plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

WP Debugging plugin

Upon activation, the plugin automatically activates WordPress debug mode, and error messages on your site will now be logged.

Enabling WordPress Debug Mode Using Code

You can also turn on WordPress debug mode using code. This method is suitable for more advanced users or if you can’t log in to your WordPress admin area.

You will need to edit your wp-config.php file using an FTP client or the file manager option in your WordPress hosting control panel.

Edit Your Website's wp-config.php File

Once you have the file open, simply find the text where it says, ‘That’s all, stop editing! Happy blogging.’

Just before this line, go ahead and add the following code:

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

For step-by-step instructions, you can see our guide on how to set up WordPress error logs in wp-config with code.

How to Find and Access WordPress Error Logs

Now that you have enabled WordPress debug mode, any future error messages on your website will be stored in the WordPress error logs.

That means that your logs will be empty at first. You will need to try to recreate the problem on your site so that the error messages can be saved to the log file.

For example, you should revisit any posts or pages that are causing an error.

Next, you must connect to your website using an FTP client or the file manager option in your WordPress hosting control panel. If you haven’t used FTP before, then you may want to see our guide on how to use FTP to upload files to WordPress.

Once you are connected to your site, navigate to the /wp-content/ folder. Inside the folder, you will find a file called debug.log. This file contains every WordPress error message, warning, and notice that has been logged.

Download, View, or Edit the debug.log File

To see the contents of this file, you will need to download, view, or edit it.

You can then inspect the error messages along with the date and time they occurred. This information can help you find a solution to the problems you are encountering on your website.

Debug.log Contains Error Messages and Time Stamps

How to Fix Issues Found in WordPress Error Logs

Once you have accessed your WordPress error logs, you can find the error message that was logged when the problem on your website happened. Remember that the times displayed are UTC, not your local time.

While most users won’t understand the error messages, they are a good place to start troubleshooting. Once you note the error message and code, you may find a solution to your problem in our guide on the 50 most common WordPress errors and how to fix them.

If you can’t find the solution on your own, then you can reach out for help on our free WPBeginner Engage Facebook Group, where you can get support from our WordPress experts and over 80,000 users. Just make sure to quote the error code or message you found in the WordPress error logs.

Other places you can turn for help are the official WordPress forums, your WordPress web hosting company’s support team, or the designated support area for the plugin or theme you are having trouble with.

When asking for support, we recommend reading our guide on how to properly ask for WordPress support and get it to learn the right way to ask questions and the best places to find help.

Disabling WordPress Debug Mode

Once you have fixed the issue on your WordPress site, we recommend disabling debug mode. Leaving it on may slow down your website and potentially leak unwanted information, which is a security risk.

If you enabled debug mode with a plugin, then simply navigate to Plugins » Installed Plugins and deactivate the WP Debugging plugin.

Deactivate the WP Debugging Plugin

If you enabled debug mode with code, then simply edit the wp-config file as you did before.

You will need to change the WP_DEBUG and WP_DEBUG_LOG lines to ‘false’.

Deactivate WordPress Debug Mode

We hope this tutorial helped you learn how to find and access your WordPress error logs. You may also want to learn how to get a free SSL certificate for your website or read our tips on how to speed up WordPress performance.

/cta

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

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

If you are trying to understand how the WordPress error logs works, you are in the right place! In this guide, we will cover all what you should know about it.

Monitoring PHP errors is something you need to do if you want to keep your WordPress website secure, healthy, and fast. If not fixed, PHP errors & warnings can indeed reduce your website performance and increase your website vulnerability to downtime and hackers.

The WordPress PHP Error Log can be your best friend in diagnosing various site issues. In this guide, we’re going deep into the subject — from how to enable PHP error logs to fixing the issues that arise.

We will also explain you how to implement a comprehensive PHP monitoring solution so you can be alerted when an error happens on your website.

Let’s get started!

TL;DR About The WordPress PHP Error Logs

  • A WordPress website can be affected by a variety of errors, including permission issues and PHP issues. If you don’t have any technical experience, it can be challenging to diagnose these problems on your site.
  • You can turn your wp-config.php file into a debugging tool by adding a few lines of code. Once you’ve identified the problem, it will be easier to troubleshoot it.
  • To activate WordPress error logs add define( ‘WP_DEBUG’, true ); above “Stop editing! Happy blogging”. in wp-config.php file.

What Are PHP Errors in WordPress?

PHP is the coding language WordPress is built on. When a user requests a web page that contains PHP code, the code is processed by the PHP module (Apache or Nginx) installed on the server.

Processing a request can generate PHP errors. This means that something is wrong with the PHP code. The error can be as simple as a missing semicolon, or as complex as calling an incorrect variable.

PHP errors can occur due to various factors

PHP errors can occur due to various factors, including your theme, plugins, database, or even server configuration. Overloading your WordPress website with plugins can increase the likelihood of these errors.

Note that, the most PHP errors that you can see on your WordPress site are usually warnings and notices. This being said, some of them (fatal errors, internal server error, etc) can stop your website from loading.

Here are The most frequent PHP errors you can encounter.

What Is a WordPress Error Log?

Indeed, even if your website seems to be working well, it may in fact be suffering from undetected PHP errors that should be fixed ASAP. The WordPress error log gives you the list of these errors.

PHP errors monitoring

Error logs provide you with information such as the error type, the error line, and the file concerned. You should use WordPress error logs to troubleshoot arising issues or understand why they’ve happened.

If the errors are coming from a third-party plugin, you should open a ticket on WordPress support forum.

Using WordPress Error Logs to Troubleshoot PHP Errors

If my explanation still looks blurry and if you don’t see the point of enabling the debugging mode for WordPress, here are some situations where you might really need it:

  • When your WordPress website doesn’t load (blank page);
  • When your web browser displays a warning with a PHP error code;
  • If a plugin isn’t working properly;
  • In case of downtime;
  • If your website is really slow;
  • If you want to improve your website performance & security;

How to Check PHP Error Logs in WordPress?

There are two ways to access PHP error logs in WordPress: manually or with a monitoring plugin. I’d personally advise to use WP Umbrella to monitor your PHP errors. It’s clearly the easiest way.

Monitor WordPress PHP errors logs with a plugin

Step 1: Get WP Umbrella Monitoring Plugin

WP Umbrella is a all-in-one solution to manage WordPress sites. It embed a PHP errors monitoring feature for WordPress.

WP Umbrella is interesting because it also checks your website’s uptime rate and provide you with automatic backups, security monitoring and much more..!

You need to install the plugin, create an account and connect your API key.

wp umbrella php errors monitoring plugin

Step 2: Go to the PHP errors monitoring tab

Then, go to WP Umbrella’s application >> PHP issues.

From here, click on the “view error” to get all the information related to the PHP errors such as:

Error details WordPress

  • The type of PHP error
  • The plugin or theme responsible
  • The environnement information (PHP version, plugin version, WordPress version)
  • When the PHP error happened

That’s it, easy peasy!

Enable WordPress PHP Error Logs Manually

If you don’t want to use an error log plugin like WP Umbrella or Query monitor, you can enable WordPress error log and retrieve PHP errors from here.

Step 1: Access the wp-config.php file

The wp-config.php file contains important WordPress settings like how to connect to your database. This is the file you need to edit in order to enable WordPress debugging mode and access WordPress error logs where you will find your PHP errors.

wp-config.php

First, you need to connect to your website using an FTP client. Then, download the wp-config.php file to make a backup of it. Then you can start editing it with your favorite HTML editor.

Step 2: Edit the wp-config.php file

define wp_debug false

Just before the line “That’s all, stop editing! Happy blogging” add this:

define( ‘WP_DEBUG’, true );
define( ‘WP_DEBUG_LOG’, true );

Or write true instead of false if the WP_debug function is already defined.

WP_DEBUG will allow you to enable debug mode and WP_DEBUG_LOG will allow you to send all errors to a file, so PHP errors are not displayed on your pages.

Save your changes and upload the file back to your website. The errors will then get logged to the debug.file within your wp-content folder. If you don’t see the file, you can create one.

This is where your WordPress error logs will be stored.

Useful Stats and Data

According to a survey by WPBeginner, over 63% of WordPress users have encountered some form of PHP error. Also, WordPress forums are filled with approximately 23% of threads related to PHP error issues in WordPress.

How to Fix The PHP Errors That You Found in The Error Log?

Regrettably, there’s no magic and universal approach to fixing issues that you discovered in your WordPress website’s error log. Every PHP error will need to be troubleshot on its own.

Here’s a breakdown of steps you can take:

  1. Understand the Error: Go through your WordPress PHP error log to grasp the issue fully.
  2. Plugin and Theme Issues: If the problem is caused by a plugin or theme, it’s best to reach out to the respective support team.
  3. Consult PHP Documentation: For complex issues, you might need to delve into official PHP documentation.
  4. Rollback Updates: Sometimes updates can cause issues. Rolling back to a previous version can sometimes fix the issue while you await an official patch.

We hope this article helped you to understand the WordPress error logs so you can troubleshoot your PHP issues!

Frequently Asked Questions About WordPress PHP Error Log

What is the location of the WordPress PHP error log?

The WordPress PHP error log is usually located within the wp-content folder.

How can I monitor PHP errors in WordPress?

You can use plugins like WP Umbrella or manually edit your wp-config.php file.

How do I fix PHP errors on my WordPress site?

Identify the issue using the PHP error log and then either disable the problematic plugin/theme or consult technical support on WordPress.org

Понравилась статья? Поделить с друзьями:
  • Ворд не подчеркивает ошибки красным 2019
  • Ворд пропало подчеркивание ошибок
  • Ворд не проверяет ошибки что делать
  • Ворд произошла серьезная ошибка во время последнего запуска
  • Ворд не показывает грамматические ошибки