1. Home
  2. References
  3. Technical Advice
  4. How to Debug a WordPress Website

How to Debug a WordPress Website

This article does not apply to N0C platform users.

In this article, we explain to cPanel users:

  • how to enable the display of errors caused by WordPress;
  • the protocol for displaying PHP-related errors; and
  • how to view errors returned by the web server.

Activate Display of WordPress Errors

To activate the display of errors caused by WordPress, simply set the appropriate directive in the wp-config.php configuration file. This file is located in the public directory where the affected WordPress installation was created. To do this :

  1. connect to cPanel -> Files -> File Manager;
  2. navigate to the directory of the site to be debugged (this will normally be the Public_html directory);
  3. find the file wp-config.php and edit it:
define('WP_DEBUG', true);

Once you have made this change, save the file and check your website for details of your specific error.

Enable PHP Error Display

It is possible that the error is not caused by WordPress, but rather results from processing of a script in PHP. For example, if the script contains a syntax error. In such cases, activating WP_Debug is useless. Instead, you need to turn to PHP errors.

You can activate PHP errors by adjusting the PHP options in your cPanel. This procedure differs according to the type of hosting service: World or HybridCloud.

The World (CloudLinux)

Activate the error display via the PHP version selector in the Software section of your cPanel:

  1. make sure you are on a non-native version of PHP;
  2. enable the following options: Log_errors and display errors.

More details on the Cloudlinux PHP version selector are provided in the article available by clicking on this link.

HybridCloud (CentOS)

You can activate error display via your cPanel’s MultiPHP INI Editor or WHM. Simply activate the Display_error option.

More details on configuring PHP on a HybridCloud are provided in the article available by clicking on this link.

View Errors Returned by the Web Server

The interface accessible via cPanel -> Metrics -> Errors allows you to view the errors returned by the web server.

Updated on 27 March 2024

Was this article helpful?

Related Articles