How to set up WordPress error logs in WP-Config

https://baijiahao.baidu.com/s?id=1622279671500148245&wfr=spider&for=pc

 

You want to set the error log in WordPress wp-config file it? WordPress wp-config file not only in control of your WordPress site settings, it is also a very useful debugging tool to help you find and fix errors. In this article, we'll show you how to set up WordPress wp-config error log file.

How to set up WordPress error in the date in WP-Config

Why and when you need to set the error log in WordPress WP-Config

wp-config.php file is an important WordPress WordPress configuration file contains settings. These settings will tell you how to connect the site to your WordPress database, which database table prefix, and generates an authentication key to make your WordPress site more secure.

In addition to the default WordPress settings, wp-config file can be used to define several other parameters. It can also enable WordPress WordPress debug mode and save the error log.

This can help you find the WordPress error by identifying the cause of their plug-ins or scripts. You can then continue to look for ways to fix these WordPress wrong.

That said, let's look at how to enable and set up WordPress wp-config error log file.

Set WordPress WP-Config error log file

First, you need to edit your wp-config.php file. You can access it by using an FTP client or cPanel the end of the file manager application to connect to your website.

You will find the wp-config.php file in the root directory of your website. Open the file in any text editor, and then look

Just before this line, you need to add the following code:

define( 'WP_DEBUG', true );

This code may already exist in your wp-config.php file, and is set to false. In this case, you only need to change it to true.

Only this line will open WordPress debug mode. However, a disadvantage of this separate debugging is that you will see WordPress errors and warnings in your home area and manage your site.

If you want to record errors, you also need to add the following code in wp-config.php file below WP_DEBUG line.

define( 'WP_DEBUG_LOG', true );

Do not forget to save your changes back to your website and upload your wp-config.php file.

Review your WordPress error log

First, you need to access your WordPress site and visit resulted in an error or warning pages. After that, you will need to use an FTP client or the File Manager application to connect to your site in your WordPress in cPanel hosting.

After connecting, go to the / wp-content / folder, where you will find a file named debug.log of.

You can download, view or edit the file. It will contain all recorded WordPress errors, warnings, and notifications.

Guess you like

Origin blog.csdn.net/james_laughing/article/details/92383961