Enabling debugging errors in WordPress can help you identify and resolve issues related to your website.

Below, we will show you the necessary steps to follow to check, activate and deactivate the debugging module using WP-CLI.

 

How to check Debugging Status

With the wp config list command you can determine whether the WP_DEBUG constant is set to true or false.

- Log in to the server via SSH as the user who will use WP-CLI.

- Use the cd command to access the root folder of the website, eg:

cd public_html

Replace public_html with the real path to the root folder of your website.

Run the following command:

wp config list WP_DEBUG

The following output should be returned:

[email protected] [~/public_html]# wp config list WP_DEBUG +----------+-------+----------+ | name     | value | type     | +----------+-------+----------+ | WP_DEBUG | false | constant | +----------+-------+----------+

 

How to enable debugging module

The WP-CLI wp config command allows you to generate a wp-config.php file, list variables, constants, and files defined in wp-config.php, set the value of a constant or variable defined in the wp-config.php file, and more others.

To enable WP_DEBUG must be set to true. By default after installing WP the value is false.

- Log in to the server via SSH as the user who will use WP-CLI.

- Use the cd command to access the root folder of the website, eg:

cd public_html

Run the following command to replace public_html with the real path to the root folder of your website:

wp config set WP_DEBUG true

It should return the following output:

[email protected] [~/public_html/wordpress]# wp config set WP_DEBUG true Success: Updated the constant 'WP_DEBUG' in the 'wp-config.php' file with the value 'true'.

! Be sure to disable the debugging module after you have finished working on your website. It is important to maintain the security of the website by hiding errors that may contain private information. The deactivation process is identical to the one described in the steps above, just set the WP_DEBUG constant to false instead of true.

 

For assistance in applying the above instructions on HostX servers please contact us. HostX offers the fastest WordPress hosting and can help you solve your problems.

Was this answer helpful? 0 Users Found This Useful (0 Votes)